"use strict";(globalThis.webpackChunkextract_css=globalThis.webpackChunkextract_css||[]).push([["25368"],{5784:(function(Pe,ne){Object.defineProperty(ne,"__esModule",{value:!0}),ne.default=void 0;var $;(function(A){A.MAIN_CONTENT=1,A.CONTENT_COLLECTION=1,A.PAGE=2,A.SPLASH_PAGE=3,A.CONTENT_ITEM=50,A.NOT_FOUND=100,A.ERROR=101,A.SEARCH=102,A.LOCK_SCREEN=103,A.POPUP_OVERLAY=104,A.PROTECTED_CONTENT=105,A.MEMBER_AREA_ACCESS_DENIED=106,A.PAYWALL=107,A.SHOW_CART=200,A.CHECKOUT=201,A.ORDER_CONFIRMED=202,A.DONATE=203,A.CONTRIBUTION_CONFIRMED=204,A.COMMERCE_CART_V2=205,A.SUBSCRIPTION_CONFIRMED=206,A.ORDER_RECEIVED=207,A.MEMBERSHIP_CONFIRMED=208,A.REVIEWS_REQUEST=209,A.DIGITAL_PRODUCT_COMPOSER_PREVIEW=210,A.ORDER_STATUS=211,A.NEWSLETTER_UNSUBSCRIBE=300,A.COMMERCE_EMAIL_PREVIEW=301,A.SSO_PAGE=400})($||($={}));var Z=ne.default=$;Pe.exports=ne.default}),149876:(function(Pe,ne,$){const Z=Symbol.for("io.opentelemetry.js.api.logs"),A=globalThis;function l(g,f,y){return O=>O===g?f:y}const J=1;class he{emit(f){}enabled(){return!1}}const ge=new he;function xe(){return ge}class ie{getLogger(f,y,O){return new he}}const ee=new ie;class De{constructor(f,y,O,C){this._provider=f,this.name=y,this.version=O,this.options=C}emit(f){this._getLogger().emit(f)}enabled(f){return this._getLogger().enabled(f)}_getLogger(){if(this._delegate)return this._delegate;const f=this._provider._getDelegateLogger(this.name,this.version,this.options);return f?(this._delegate=f,this._delegate):ge}}class _e{getLogger(f,y,O){var C;return(C=this._getDelegateLogger(f,y,O))!==null&&C!==void 0?C:new De(this,f,y,O)}_getDelegate(){var f;return(f=this._delegate)!==null&&f!==void 0?f:ee}_setDelegate(f){this._delegate=f}_getDelegateLogger(f,y,O){var C;return(C=this._delegate)===null||C===void 0?void 0:C.getLogger(f,y,O)}}class Me{constructor(){this._proxyLoggerProvider=new _e}static getInstance(){return this._instance||(this._instance=new Me),this._instance}setGlobalLoggerProvider(f){return A[Z]?this.getLoggerProvider():(A[Z]=l(J,f,ee),this._proxyLoggerProvider._setDelegate(f),f)}getLoggerProvider(){var f,y;return(y=(f=A[Z])===null||f===void 0?void 0:f.call(A,J))!==null&&y!==void 0?y:this._proxyLoggerProvider}getLogger(f,y,O){return this.getLoggerProvider().getLogger(f,y,O)}disable(){delete A[Z],this._proxyLoggerProvider=new _e}}const pe=Me.getInstance();var ve;(function(g){g[g.UNSPECIFIED=0]="UNSPECIFIED",g[g.TRACE=1]="TRACE",g[g.TRACE2=2]="TRACE2",g[g.TRACE3=3]="TRACE3",g[g.TRACE4=4]="TRACE4",g[g.DEBUG=5]="DEBUG",g[g.DEBUG2=6]="DEBUG2",g[g.DEBUG3=7]="DEBUG3",g[g.DEBUG4=8]="DEBUG4",g[g.INFO=9]="INFO",g[g.INFO2=10]="INFO2",g[g.INFO3=11]="INFO3",g[g.INFO4=12]="INFO4",g[g.WARN=13]="WARN",g[g.WARN2=14]="WARN2",g[g.WARN3=15]="WARN3",g[g.WARN4=16]="WARN4",g[g.ERROR=17]="ERROR",g[g.ERROR2=18]="ERROR2",g[g.ERROR3=19]="ERROR3",g[g.ERROR4=20]="ERROR4",g[g.FATAL=21]="FATAL",g[g.FATAL2=22]="FATAL2",g[g.FATAL3=23]="FATAL3",g[g.FATAL4=24]="FATAL4"})(ve||(ve={}));var Ue=$(180718),k=$(123659),x=$(5784),U=$.n(x),B=$(140597);const H={"commerce-cart":1,"v7-user-sites":1,"v7_1-user-sites":1},F=window.Static&&window.Static.SQUARESPACE_CONTEXT,$e=window.top!==window,Et=!!F&&Object.keys(F).length>0,qe=Object.freeze({[U().COMMERCE_CART_V2]:"commerce-cart"});function tt(){return{releaseVariant:"default",inFrame:$e,templateId:F.templateId||"",impersonatedSession:!!F.impersonatedSession,pageType:typeof F.pageType=="number"?F.pageType:-1}}function se(){const{website:g={}}=F;return{authenticUrl:g.authenticUrl||"",cloneable:!!g.cloneable,developerMode:!!g.developerMode,isHstsEnabled:!!g.isHstsEnabled,language:g.language||"",timeZone:g.timeZone||"",websiteId:g.id||"",websiteType:g.websiteType||-1}}function rt(){const{collection:g={}}=F;return{collectionType:g.type||-1}}function Tt(){const g=new Set;return document.querySelectorAll("style[data-sqsp-font-ids]").forEach(f=>{(f.getAttribute("data-sqsp-font-ids")||"").split(",").map(y=>y.trim()).filter(Boolean).forEach(y=>g.add(y))}),Array.from(g)}function wt(){const g=document.querySelectorAll('link[rel=preconnect][href*="gstatic.com"]').length>0,f=document.querySelectorAll('script[src*="typekit"][async]').length>0,y=document.querySelectorAll("style[data-customfonts]").length>0,O=Tt();return{google_fonts_enabled:g,typekit_fonts_enabled:f,custom_fonts_enabled:y,font_ids_csv:O.join(",")}}function Ye(){const g=F?.websiteStyles?.animations?.["tweak-global-animations-enabled"];return{global_animations_enabled:g!==void 0?g==="true":F?.tweakJSON?.["tweak-global-animations-enabled"]==="true"}}function Y(){return{block_animations_enabled:document.querySelector("script[data-block-animations]")!==null}}function Ee(){return{num_stack_components:document.querySelectorAll('.sqs-block[data-definition-name="website.components.stack"]').length}}function Te(){const g={inViewportLazyImgs:0,inViewportLazyVideos:0,outsideViewportEagerImgs:0,outsideViewportEagerVideos:0},f=document.querySelectorAll("img, video");return f.length?new Promise(y=>{const O=new Set(f),C=new IntersectionObserver(V=>{V.forEach(K=>{let{target:le,isIntersecting:Ae}=K;if(!O.delete(le))return;const Q=le.tagName==="IMG",ae=le.loading==="lazy";Ae&&ae?g[Q?"inViewportLazyImgs":"inViewportLazyVideos"]++:!Ae&&!ae&&g[Q?"outsideViewportEagerImgs":"outsideViewportEagerVideos"]++,C.unobserve(le)}),O.size||(C.disconnect(),y(g))});f.forEach(V=>C.observe(V))}):Promise.resolve(g)}const oe={media_viewport:Te};async function Fe(g,f,y){if(!g.enabled)return;const O=pe.getLogger(f.appName,"b027e3c29984720050c5301fcdda1c6c637a56ec");for(const[C,V]of Object.entries(y)){const K=await Promise.resolve(V()),le=C.split("_")[0];O.emit({severityNumber:ve.INFO,severityText:"INFO",body:K,attributes:{"event.name":`sqsp.site.${C}`,...Object.fromEntries(Object.entries(K).map(Ae=>{let[Q,ae]=Ae;return[`sqsp.${le}.${Q}`,ae]}))}})}}function At(){return F.hasOwnProperty("templateVersion")?F.templateVersion.replace(".","_"):null}function we(g){const f=H[g]??0;return Math.random()<=f}function G(g){const y={appName:qe[F.pageType]||`v${g}-user-sites`,context:{...tt(),...se(),...rt(),...Ye(),...Y(),...wt(),...Ee()},captureException:(O,C)=>{(0,B.$e)(V=>{V.setTag("product_area","rum-collector"),C!==void 0&&V.setExtra("extras",C),(0,B.Tb)(O)})}};return we(y.appName)&&(y.serviceURL="https://performance.squarespace.com/api/v1/records"),y}function bt(){if(!Et||F.env!=="PRODUCTION")return;const g=At();if(g===null)return;const f=G(g),y=3e4;(0,k.S1)(f),(0,Ue.S)({serviceName:f.appName,serviceVersion:"b027e3c29984720050c5301fcdda1c6c637a56ec",context:f.context,sampleRate:.1,instrumentations:{resourceTiming:!1,navigation:!1,userAction:!1,webVitals:{includeRawAttribution:!0}},captureException:(O,C)=>{(0,B.$e)(V=>{V.setTag("product_area","otel-browser"),C!==void 0&&V.setExtra("extras",C),(0,B.Tb)(O)})}}).then(O=>{const C=()=>{Fe(O,f,oe),setTimeout(()=>{O.shutdown().catch(V=>{console.error("Error shutting down @sqs/otel-browser",V)})},y)};document.readyState==="complete"?C():window.addEventListener("load",C,{once:!0})}).catch(O=>{console.error("Error initializing @sqs/otel-browser",O)})}bt()}),140597:(function(Pe,ne,$){$.d(ne,{$e:()=>pe,Cr:()=>ge,Ei:()=>Ue,Tb:()=>_e,nZ:()=>ve,n_:()=>ee,uT:()=>De});const Z=()=>{},A=k=>function(x){for(var U=arguments.length,B=new Array(U>1?U-1:0),H=1;Hfunction(x){for(var U=arguments.length,B=new Array(U>1?U-1:0),H=1;H{let{category:x,message:U}=k;console.log(`[Sentry][addBreadcrumb] (${x}) ${U}`)};let ge=!1;function xe(){return new Proxy({},{get:()=>Z})}const ie=function(){for(var k=arguments.length,x=new Array(k),U=0;UIc});var Z=Object.defineProperty,A=(e,t,r)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t,r)=>(A(e,typeof t!="symbol"?t+"":t,r),r),J;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(J||(J={}));var he=class{emit(e){}enabled(){return!1}},ge=new he;function xe(){return ge}var ie=Symbol.for("io.opentelemetry.js.api.logs"),ee=globalThis;function De(e,t,r){return n=>n===e?t:r}var _e=1,Me=class{getLogger(e,t,r){return new he}},pe=new Me,ve=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):ge}},Ue=class{getLogger(e,t,r){var n;return(n=this._getDelegateLogger(e,t,r))!==null&&n!==void 0?n:new ve(this,e,t,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:pe}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var n;return(n=this._delegate)===null||n===void 0?void 0:n.getLogger(e,t,r)}},k=class ts{constructor(){this._proxyLoggerProvider=new Ue}static getInstance(){return this._instance||(this._instance=new ts),this._instance}setGlobalLoggerProvider(t){return ee[ie]?this.getLoggerProvider():(ee[ie]=De(_e,t,pe),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=ee[ie])===null||t===void 0?void 0:t.call(ee,_e))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete ee[ie],this._proxyLoggerProvider=new Ue}},x=k.getInstance(),U=class{constructor(e){l(this,"_delegate"),this._delegate=e}export(e,t){this._delegate.export(e,t)}forceFlush(){return this._delegate.forceFlush()}shutdown(){return this._delegate.shutdown()}},B=class extends Error{constructor(e,t,r){super(e),l(this,"code"),l(this,"name","OTLPExporterError"),l(this,"data"),this.data=r,this.code=t}};function H(e){if(Number.isFinite(e)&&e>0)return e;throw new Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`)}function F(e){if(e!=null)return async()=>e}function $e(e,t,r){return{timeoutMillis:H(e.timeoutMillis??t.timeoutMillis??r.timeoutMillis),concurrencyLimit:e.concurrencyLimit??t.concurrencyLimit??r.concurrencyLimit,compression:e.compression??t.compression??r.compression}}function Et(){return{timeoutMillis:1e4,concurrencyLimit:30,compression:"none"}}var qe=class{constructor(e){l(this,"_concurrencyLimit"),l(this,"_sendingPromises",[]),this._concurrencyLimit=e}pushPromise(e){if(this.hasReachedLimit())throw new Error("Concurrency Limit reached");this._sendingPromises.push(e);const t=()=>{const r=this._sendingPromises.indexOf(e);this._sendingPromises.splice(r,1)};e.then(t,t)}hasReachedLimit(){return this._sendingPromises.length>=this._concurrencyLimit}async awaitAll(){await Promise.all(this._sendingPromises)}};function tt(e){return new qe(e.concurrencyLimit)}var se="1.9.1",rt=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function Tt(e){const t=new Set([e]),r=new Set,n=e.match(rt);if(!n)return()=>!1;const s={major:+n[1],minor:+n[2],patch:+n[3],prerelease:n[4]};if(s.prerelease!=null)return function(m){return m===e};function a(_){return r.add(_),!1}function d(_){return t.add(_),!0}return function(m){if(t.has(m))return!0;if(r.has(m))return!1;const T=m.match(rt);if(!T)return a(m);const E={major:+T[1],minor:+T[2],patch:+T[3],prerelease:T[4]};return E.prerelease!=null||s.major!==E.major?a(m):s.major===0?s.minor===E.minor&&s.patch<=E.patch?d(m):a(m):s.minor<=E.minor?d(m):a(m)}}var wt=Tt(se),Ye=se.split(".")[0],Y=Symbol.for(`opentelemetry.js.api.${Ye}`),Ee=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{};function Te(e,t,r,n=!1){var s;const a=Ee[Y]=(s=Ee[Y])!==null&&s!==void 0?s:{version:se};if(!n&&a[e]){const d=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return r.error(d.stack||d.message),!1}if(a.version!==se){const d=new Error(`@opentelemetry/api: Registration of version v${a.version} for ${e} does not match previously registered API v${se}`);return r.error(d.stack||d.message),!1}return a[e]=t,r.debug(`@opentelemetry/api: Registered a global for ${e} v${se}.`),!0}function oe(e){var t,r;const n=(t=Ee[Y])===null||t===void 0?void 0:t.version;if(!(!n||!wt(n)))return(r=Ee[Y])===null||r===void 0?void 0:r[e]}function Fe(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${se}.`);const r=Ee[Y];r&&delete r[e]}var At=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return we("debug",this._namespace,e)}error(...e){return we("error",this._namespace,e)}info(...e){return we("info",this._namespace,e)}warn(...e){return we("warn",this._namespace,e)}verbose(...e){return we("verbose",this._namespace,e)}};function we(e,t,r){const n=oe("diag");if(n)return n[e](t,...r)}var G;(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(G||(G={}));function bt(e,t){eG.ALL&&(e=G.ALL),t=t||{};function r(n,s){const a=t[n];return typeof a=="function"&&e>=s?a.bind(t):function(){}}return{error:r("error",G.ERROR),warn:r("warn",G.WARN),info:r("info",G.INFO),debug:r("debug",G.DEBUG),verbose:r("verbose",G.VERBOSE)}}var g="diag",f=class rs{static instance(){return this._instance||(this._instance=new rs),this._instance}constructor(){function t(s){return function(...a){const d=oe("diag");if(d)return d[s](...a)}}const r=this,n=(s,a={logLevel:G.INFO})=>{var d,_,m;if(s===r){const P=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return r.error((d=P.stack)!==null&&d!==void 0?d:P.message),!1}typeof a=="number"&&(a={logLevel:a});const T=oe("diag"),E=bt((_=a.logLevel)!==null&&_!==void 0?_:G.INFO,s);if(T&&!a.suppressOverrideMessage){const P=(m=new Error().stack)!==null&&m!==void 0?m:"";T.warn(`Current logger will be overwritten from ${P}`),E.warn(`Current logger will overwrite one already registered from ${P}`)}return Te("diag",E,r,!0)};r.setLogger=n,r.disable=()=>{Fe(g,r)},r.createComponentLogger=s=>new At(s),r.verbose=t("verbose"),r.debug=t("debug"),r.info=t("info"),r.warn=t("warn"),r.error=t("error")}};function y(e){return Symbol.for(e)}var O=class Jn{constructor(t){const r=this;r._currentContext=t?new Map(t):new Map,r.getValue=n=>r._currentContext.get(n),r.setValue=(n,s)=>{const a=new Jn(r._currentContext);return a._currentContext.set(n,s),a},r.deleteValue=n=>{const s=new Jn(r._currentContext);return s._currentContext.delete(n),s}}},C=new O,V=class{constructor(){}createGauge(e,t){return nt}createHistogram(e,t){return sr}createCounter(e,t){return ir}createUpDownCounter(e,t){return Wr}createObservableGauge(e,t){return yt}createObservableCounter(e,t){return or}createObservableUpDownCounter(e,t){return ar}addBatchObservableCallback(e,t){}removeBatchObservableCallback(e){}},K=class{},le=class extends K{add(e,t){}},Ae=class extends K{add(e,t){}},Q=class extends K{record(e,t){}},ae=class extends K{record(e,t){}},ce=class{addCallback(e){}removeCallback(e){}},rr=class extends ce{},Rt=class extends ce{},nr=class extends ce{},be=new V,ir=new le,nt=new Q,sr=new ae,Wr=new Ae,or=new rr,yt=new Rt,ar=new nr;function cr(){return be}var ur=class{active(){return C}with(e,t,r,...n){return t.call(r,...n)}bind(e,t){return t}enable(){return this}disable(){return this}},St="context",Ke=new ur,Ot=class ns{constructor(){}static getInstance(){return this._instance||(this._instance=new ns),this._instance}setGlobalContextManager(t){return Te(St,t,f.instance())}active(){return this._getContextManager().active()}with(t,r,n,...s){return this._getContextManager().with(t,r,n,...s)}bind(t,r){return this._getContextManager().bind(t,r)}_getContextManager(){return oe(St)||Ke}disable(){this._getContextManager().disable(),Fe(St,f.instance())}},ke;(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(ke||(ke={}));var Lt="0000000000000000",dr="00000000000000000000000000000000",lr={traceId:dr,spanId:Lt,traceFlags:ke.NONE},Be=class{constructor(e=lr){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,t){return this}setAttributes(e){return this}addEvent(e,t){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,t){}},Ct=y("OpenTelemetry Context Key SPAN");function it(e){return e.getValue(Ct)||void 0}function It(){return it(Ot.getInstance().active())}function Ve(e,t){return e.setValue(Ct,t)}function zr(e){return e.deleteValue(Ct)}function hr(e,t){return Ve(e,new Be(t))}function gr(e){var t;return(t=it(e))===null||t===void 0?void 0:t.spanContext()}var Qe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function Nt(e,t){if(typeof e!="string"||e.length!==t)return!1;let r=0;for(let n=0;n{S.error(ti(e))}}function ti(e){return typeof e=="string"?e:JSON.stringify(Tr(e))}function Tr(e){const t={};let r=e;for(;r!==null;)Object.getOwnPropertyNames(r).forEach(n=>{if(t[n])return;const s=r[n];s&&(t[n]=String(s))}),r=Object.getPrototypeOf(r);return t}var Mt=Xr();function Ge(e){try{Mt(e)}catch{}}var Zr="2.8.0",Se="exception.message",ct="exception.stacktrace",Ze="exception.type",Jr="service.name",Ut="telemetry.sdk.language",en="webjs",Ft="telemetry.sdk.name",kt="telemetry.sdk.version",tn="process.runtime.name",Bt={[Ft]:"opentelemetry",[tn]:"browser",[Ut]:en,[kt]:Zr},Vt=performance,wr=9,Ar=6,rn=Math.pow(10,Ar),Ht=Math.pow(10,wr);function ut(e){const t=e/1e3,r=Math.trunc(t),n=Math.round(e%1e3*rn);return[r,n]}function br(e){const t=ut(Vt.timeOrigin),r=ut(typeof e=="number"?e:Vt.now());return dt(t,r)}function Gt(e){if(yr(e))return e;if(typeof e=="number")return e=Ht&&(r[1]-=Ht,r[0]+=1),r}var te;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(te||(te={}));var sn=class os extends Error{constructor(t){super(t),Object.setPrototypeOf(this,os.prototype)}};function on(e,t){let r;const n=new Promise(function(a,d){r=setTimeout(function(){d(new sn("Operation timed out."))},t)});return Promise.race([e,n]).then(s=>(clearTimeout(r),s),s=>{throw clearTimeout(r),s})}function an(e,t){return typeof t=="string"?e===t:!!e.match(t)}function cn(e,t){if(!t)return!1;for(const r of t)if(an(e,r))return!0;return!1}var un=class{constructor(){l(this,"_promise"),l(this,"_resolve"),l(this,"_reject"),this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}},Wt=class{constructor(e,t){l(this,"_isCalled",!1),l(this,"_deferred",new un),l(this,"_callback"),l(this,"_that"),this._callback=e,this._that=t}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};function dn(e,t){return new Promise(r=>{Re.with(Er(Re.active()),()=>{e.export(t,r)})})}var ln={_export:dn};function hn(e){return Object.prototype.hasOwnProperty.call(e,"partialSuccess")}function gn(){return{handleResponse(e){e==null||!hn(e)||e.partialSuccess==null||Object.keys(e.partialSuccess).length===0||S.warn("Received Partial Success response:",JSON.stringify(e.partialSuccess))}}}var _n=class{constructor(e,t,r,n,s){l(this,"_diagLogger"),l(this,"_transport"),l(this,"_serializer"),l(this,"_responseHandler"),l(this,"_promiseQueue"),l(this,"_timeout"),this._transport=e,this._serializer=t,this._responseHandler=r,this._promiseQueue=n,this._timeout=s,this._diagLogger=S.createComponentLogger({namespace:"OTLPExportDelegate"})}export(e,t){if(this._diagLogger.debug("items to be sent",e),this._promiseQueue.hasReachedLimit()){t({code:te.FAILED,error:new Error("Concurrent export limit reached")});return}const r=this._serializer.serializeRequest(e);if(r==null){t({code:te.FAILED,error:new Error("Nothing to send")});return}this._promiseQueue.pushPromise(this._transport.send(r,this._timeout).then(n=>{if(n.status==="success"){if(n.data!=null)try{this._responseHandler.handleResponse(this._serializer.deserializeResponse(n.data))}catch(s){this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?",s,n.data)}t({code:te.SUCCESS});return}else if(n.status==="failure"&&n.error){t({code:te.FAILED,error:n.error});return}else n.status==="retryable"?t({code:te.FAILED,error:n.error??new B("Export failed with retryable status")}):t({code:te.FAILED,error:new B("Export failed with unknown error")})},n=>t({code:te.FAILED,error:n})))}forceFlush(){return this._promiseQueue.awaitAll()}async shutdown(){this._diagLogger.debug("shutdown started"),await this.forceFlush(),this._transport.shutdown()}};function Oe(e,t){return new _n(e.transport,e.serializer,gn(),e.promiseHandler,t.timeout)}function zt(e,t,r){return Oe({transport:r,serializer:t,promiseHandler:tt(e)},{timeout:e.timeoutMillis})}var Je;function We(){if(Je===void 0)try{const e=globalThis.process.argv0;Je=e?`unknown_service:${e}`:"unknown_service"}catch{Je="unknown_service"}return Je}var ze=e=>e!==null&&typeof e=="object"&&typeof e.then=="function",mn=class ei{constructor(t,r){l(this,"_rawAttributes"),l(this,"_asyncAttributesPending",!1),l(this,"_schemaUrl"),l(this,"_memoizedAttributes");const n=t.attributes??{};this._rawAttributes=Object.entries(n).map(([s,a])=>(ze(a)&&(this._asyncAttributesPending=!0),[s,a])),this._rawAttributes=jt(this._rawAttributes),this._schemaUrl=pn(r?.schemaUrl)}static FromAttributeList(t,r){const n=new ei({},r);return n._rawAttributes=jt(t),n._asyncAttributesPending=t.filter(([s,a])=>ze(a)).length>0,n}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let t=0;tze(r)?[t,r.catch(n=>{S.debug("promise rejection for resource attribute: %s - %s",t,n)})]:[t,r])}function pn(e){if(typeof e=="string"||e===void 0)return e;S.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.",e)}function vn(e,t){const r=e?.schemaUrl,n=t?.schemaUrl,s=r===void 0||r==="",a=n===void 0||n==="";if(s)return n;if(a||r===n)return r;S.warn('Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.',r,n)}function En(e,t){const r={attributes:$t(e.attributes,t),droppedAttributesCount:0},n=e.schemaUrl;return n&&n!==""&&(r.schemaUrl=n),r}function Or(e,t){const r={name:e.name,version:e.version};return e.attributes&&Object.keys(e.attributes).length>0&&(r.attributes=$t(e.attributes,t),r.droppedAttributesCount=e.droppedAttributesCount??0),r}function $t(e,t){return Object.keys(e).map(r=>Lr(r,e[r],t))}function Lr(e,t,r){return{key:e,value:Le(t,r)}}function Le(e,t){const r=typeof e;if(r==="string")return{stringValue:e};if(r==="number")return Number.isInteger(e)?{intValue:e}:{doubleValue:e};if(r==="boolean")return{boolValue:e};if(e instanceof Uint8Array)return{bytesValue:t.encodeUint8Array(e)};if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s{const a=En(n,t);return{resource:a,scopeLogs:Array.from(s,([,d])=>({scope:Or(d[0].instrumentationScope,t),logRecords:d.map(_=>Cr(_,t)),schemaUrl:d[0].instrumentationScope.schemaUrl})),schemaUrl:a.schemaUrl}})}function Cr(e,t){return{timeUnixNano:t.encodeHrTime(e.hrTime),observedTimeUnixNano:t.encodeHrTime(e.hrTimeObserved),severityNumber:e.severityNumber,severityText:e.severityText,body:Le(e.body,t),eventName:e.eventName,attributes:$t(e.attributes,t),droppedAttributesCount:e.droppedAttributesCount,flags:e.spanContext?.traceFlags,traceId:t.encodeOptionalSpanContext(e.spanContext?.traceId),spanId:t.encodeOptionalSpanContext(e.spanContext?.spanId)}}function ri(e){return e}function bn(e){const t=BigInt(1e9);return BigInt(Math.trunc(e[0]))*t+BigInt(Math.trunc(e[1]))}function Rn(e){return bn(e).toString()}var yn=typeof BigInt<"u"?Rn:nn;function Ir(e){return e}var Nr={encodeHrTime:yn,encodeSpanContext:Ir,encodeOptionalSpanContext:Ir,encodeUint8Array:e=>{if(typeof Buffer<"u")return Buffer.from(e).toString("base64");const t=new Array(e.length);for(let r=0;r{const t=Tn(e,Nr);return new TextEncoder().encode(JSON.stringify(t))},deserializeResponse:e=>{if(e.length===0)return{};const t=new TextDecoder;try{return JSON.parse(t.decode(e))}catch(r){return S.warn(`Failed to parse logs export response: ${r.message}. Returning empty response`),{}}}},qt=5,On=1e3,Pr=5e3,Ln=1.5,Cn=.2;function i(){return Math.random()*(2*Cn)-Cn}var o=class{constructor(e){l(this,"_transport"),this._transport=e}retry(e,t,r){return new Promise((n,s)=>{setTimeout(()=>{this._transport.send(e,t).then(n,s)},r)})}async send(e,t){let r=qt,n=On;const s=Date.now()+t;let a=await this._transport.send(e,t);for(;a.status==="retryable"&&r>0;){r--;const d=Math.max(Math.min(n*(1+i()),Pr),0);n=n*Ln;const _=a.retryInMillis??d,m=s-Date.now();if(_>m)return S.info(`Export retry time ${Math.round(_)}ms exceeds remaining timeout ${Math.round(m)}ms, not retrying further.`),a;S.verbose(`Scheduling export retry in ${Math.round(_)}ms`),a=await this.retry(e,m,_)}return a.status==="success"?S.verbose(`Export succeeded after ${qt-r} retry attempts.`):a.status==="retryable"?S.info(`Export failed after maximum retry attempts (${qt}).`):S.info(`Export failed with non-retryable error: ${a.error}`),a}shutdown(){return this._transport.shutdown()}};function c(e){return new o(e.transport)}function u(e){return e===429||e===502||e===503||e===504}function h(e){if(e==null)return;const t=Number.parseInt(e,10);if(Number.isInteger(t))return t>0?t*1e3:-1;const r=new Date(e).getTime()-Date.now();return r>=0?r:0}var p=60*1024,v=9,b=0,R=0,D=class{constructor(e){l(this,"_parameters"),this._parameters=e}async send(e,t){const r=new AbortController,n=setTimeout(()=>r.abort(),t);let s=globalThis.fetch;typeof s.__original=="function"&&(s=s.__original);const a=e.byteLength,d=b+a>p,_=R>=v,m=!d&&!_;if(m)b+=a,R++;else{const T=d?"size limit":"count limit";S.debug(`keepalive disabled: ${(a/1024).toFixed(1)}KB payload, ${R} pending (${T})`)}try{const T=new URL(this._parameters.url),E=await s(T.href,{method:"POST",headers:await this._parameters.headers(),body:e,signal:r.signal,keepalive:m,mode:globalThis.location?globalThis.location.origin===T.origin?"same-origin":"cors":"no-cors"});if(E.status>=200&&E.status<=299)return S.debug(`export response success (status: ${E.status})`),{status:"success"};if(u(E.status)){S.warn(`export response retryable (status: ${E.status})`);const P=E.headers.get("Retry-After");return{status:"retryable",retryInMillis:h(P)}}return S.error(`export response failure (status: ${E.status})`),{status:"failure",error:new Error(`Fetch request failed with non-retryable status ${E.status}`)}}catch(T){return q(T)?(S.warn(`export request retryable (network error: ${T})`),{status:"retryable",error:new Error("Fetch request encountered a network error",{cause:T})}):(S.error(`export request failure (error: ${T})`),{status:"failure",error:new Error("Fetch request errored",{cause:T})})}finally{clearTimeout(n),m&&(b-=a,R--)}}shutdown(){}};function M(e){return new D(e)}function q(e){return e instanceof TypeError&&!e.cause}function re(e,t){return zt(e,t,c({transport:M(e)}))}function Yt(e){const t={};return Object.entries(e??{}).forEach(([r,n])=>{typeof n<"u"?t[r]=String(n):S.warn(`Header "${r}" has invalid value (${n}) and will be ignored`)}),t}function lt(e,t,r){return async()=>{const n={...await r()},s={};return t!=null&&Object.assign(s,await t()),e!=null&&Object.assign(s,Yt(await e())),Object.assign(s,n)}}function cs(e){if(e!=null)try{const t=globalThis.location?.href;return new URL(e,t).href}catch{throw new Error(`Configuration: Could not parse user-provided export URL: '${e}'`)}}function us(e,t,r){return{...$e(e,t,r),headers:lt(e.headers,t.headers,r.headers),url:cs(e.url)??t.url??r.url}}function ds(e,t){return{...Et(),headers:async()=>e,url:"http://localhost:4318/"+t}}function ls(e){return typeof e.headers=="function"?e.headers:F(e.headers)}function hs(e,t,r){return us({url:e.url,timeoutMillis:e.timeoutMillis,headers:ls(e),concurrencyLimit:e.concurrencyLimit},{},ds(r,t))}function gs(e,t,r,n){const s=hs(e,r,n);return re(s,t)}var _s=class extends U{constructor(e={}){super(gs(e,Sn,"v1/logs",{"Content-Type":"application/json"}))}};function ms(e,t,r,n){for(let s=0,a=e.length;st.disable())}function ps(e){const t=e.tracerProvider||Xe.getTracerProvider(),r=e.meterProvider||ye.getMeterProvider(),n=e.loggerProvider||x.getLoggerProvider(),s=e.instrumentations?.flat()??[];return ms(s,t,r,n),()=>{fs(s)}}function vs(e){return In(e,new WeakSet)}function In(e,t){if(e==null||typeof e=="string"||typeof e=="number"||typeof e=="boolean"||e instanceof Uint8Array)return!0;if(typeof e=="object"){if(t.has(e))return!1;if(t.add(e),Array.isArray(e)){for(const n of e)if(!In(n,t))return!1;return!0}const r=e;if(r.constructor!==Object&&r.constructor!==void 0)return!1;for(const n in r)if(Object.prototype.hasOwnProperty.call(r,n)&&!In(r[n],t))return!1;return!0}return!1}var de;(function(e){e[e.DROP_INVALID=0]="DROP_INVALID",e[e.DROP_LIMIT_REACHED=1]="DROP_LIMIT_REACHED",e[e.ADD_NEW=2]="ADD_NEW",e[e.ADD_OVERWRITE_EXISTING=3]="ADD_OVERWRITE_EXISTING"})(de||(de={}));function ni(e,t,r,n,s){if(n.length===0)return S.warn(`Invalid attribute key: ${n}`),de.DROP_INVALID;if(!vs(s))return S.warn(`Invalid attribute value set for key: ${n}`),de.DROP_INVALID;const a=!Object.prototype.hasOwnProperty.call(e,n);return a&&r>=t.attributeCountLimit?de.DROP_LIMIT_REACHED:(e[n]=Nn(s,t.attributeValueLengthLimit),a?de.ADD_NEW:de.ADD_OVERWRITE_EXISTING)}function Nn(e,t){if(t<=0)return S.warn(`Attribute value limit must be positive, got ${t}`),e;if(e==null)return e;if(typeof e=="string")return e.length<=t?e:e.substring(0,t);if(e instanceof Uint8Array)return e;if(Array.isArray(e))return e.map(r=>Nn(r,t));if(typeof e=="object"){const r={};for(const[n,s]of Object.entries(e))r[n]=Nn(s,t);return r}return e}function Es(e,t){if(t==null)return{};const r={};let n=0,s=0;for(const[a,d]of Object.entries(t)){const _=ni(r,e,n,a,d);_===de.ADD_NEW?n+=1:(_===de.DROP_INVALID||_===de.DROP_LIMIT_REACHED)&&(s+=1)}return{attributes:n>0?r:void 0,droppedAttributesCount:s}}var Ts=class{constructor(e,t,r){l(this,"hrTime"),l(this,"hrTimeObserved"),l(this,"spanContext"),l(this,"resource"),l(this,"instrumentationScope"),l(this,"attributes",{}),l(this,"_severityText"),l(this,"_severityNumber"),l(this,"_body"),l(this,"_eventName"),l(this,"_attributesCount",0),l(this,"_droppedAttributesCount",0),l(this,"_isReadonly",!1),l(this,"_logRecordLimits");const{timestamp:n,observedTimestamp:s,eventName:a,severityNumber:d,severityText:_,body:m,attributes:T={},exception:E,context:P}=r,W=Date.now();if(this.hrTime=Gt(n??W),this.hrTimeObserved=Gt(s??W),P){const w=Xe.getSpanContext(P);w&&He(w)&&(this.spanContext=w)}this.severityNumber=d,this.severityText=_,this.body=m,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this._eventName=a,this.setAttributes(T),E!=null&&this._setException(E)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get eventName(){return this._eventName}set eventName(e){this._isLogRecordReadonly()||(this._eventName=e)}get droppedAttributesCount(){return this._droppedAttributesCount}setAttribute(e,t){if(this._isLogRecordReadonly())return this;const r=ni(this.attributes,this._logRecordLimits,this._attributesCount,e,t);return r===de.DROP_LIMIT_REACHED?(this._droppedAttributesCount++,this._droppedAttributesCount===1&&S.warn("Dropping extra attributes.")):r===de.ADD_NEW&&this._attributesCount++,this}setAttributes(e){for(const[t,r]of Object.entries(e))this.setAttribute(t,r);return this}setBody(e){return this.body=e,this}setEventName(e){return this.eventName=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_setException(e){let t=!1;if(typeof e=="string"||typeof e=="number")Object.hasOwn(this.attributes,Se)||this.setAttribute(Se,String(e)),t=!0;else if(e&&typeof e=="object"){const r=e;r.code?(Object.hasOwn(this.attributes,Ze)||this.setAttribute(Ze,r.code.toString()),t=!0):r.name&&(Object.hasOwn(this.attributes,Ze)||this.setAttribute(Ze,r.name),t=!0),r.message&&(Object.hasOwn(this.attributes,Se)||this.setAttribute(Se,r.message),t=!0),r.stack&&(Object.hasOwn(this.attributes,ct)||this.setAttribute(ct,r.stack),t=!0)}t||S.warn(`Failed to record an exception ${e}`)}_isLogRecordReadonly(){return this._isReadonly&&S.warn("Can not execute the operation on emitted log record"),this._isReadonly}},ws=class{constructor(e,t){l(this,"_instrumentationScope"),l(this,"_sharedState"),l(this,"_loggerConfig"),this._instrumentationScope=e,this._sharedState=t,this._loggerConfig=this._sharedState.getLoggerConfig(this._instrumentationScope)}emit(e){const t=e.context||Re.active();if(!this.enabled(e))return;const r=new Ts(this._sharedState,this._instrumentationScope,{context:t,...e});this._sharedState.loggerMetrics.emitLog(),this._sharedState.activeProcessor.onEmit(r,t),r._makeReadonly()}enabled(e){const t=this._loggerConfig;if(t.disabled)return!1;const r=e?.severityNumber;if(typeof r=="number"&&r!==J.UNSPECIFIED&&ron(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(r=>r.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}enabled(e){for(const t of this.processors)if(!t.enabled||t.enabled(e))return!0;return!1}};function Pn(e){if(e===void 0)return["u",null];if(e===null)return["n",null];const t=typeof e;return t==="string"?["s",e]:t==="boolean"?["b",e]:t==="number"?Number.isNaN(e)?["nan",null]:e===1/0?["inf",null]:e===-1/0?["-inf",null]:Object.is(e,-0)?["n0",null]:["d",e]:e instanceof Uint8Array?["bytes",Array.from(e)]:Array.isArray(e)?["arr",e.map(Pn)]:["map",Object.entries(e).sort(([r],[n])=>r.localeCompare(n)).map(([r,n])=>[r,Pn(n)])]}function ii(e){return JSON.stringify([e.name,e.version||"",e.schemaUrl||"",Pn(e.attributes),e.droppedAttributesCount??0])}var Rs="otel.sdk.log.created",ys=class{constructor(e){l(this,"createdLogs"),this.createdLogs=e.createCounter(Rs,{unit:"{log_record}",description:"The number of logs submitted to enabled SDK Loggers."})}emitLog(){this.createdLogs.add(1)}},Ss="0.219.0",Os={disabled:!1,minimumSeverity:J.UNSPECIFIED,traceBased:!1},si=()=>({...Os}),Ls=class{constructor(e,t,r,n,s,a){l(this,"loggers",new Map),l(this,"activeProcessor"),l(this,"registeredLogRecordProcessors",[]),l(this,"resource"),l(this,"forceFlushTimeoutMillis"),l(this,"logRecordLimits"),l(this,"processors"),l(this,"loggerMetrics"),l(this,"_loggerConfigurator"),l(this,"_loggerConfigs",new Map),this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=r,this.processors=n,n.length>0?(this.registeredLogRecordProcessors=n,this.activeProcessor=new bs(this.registeredLogRecordProcessors,this.forceFlushTimeoutMillis)):this.activeProcessor=new As,this._loggerConfigurator=s??si;const d=a?a.getMeter("@opentelemetry/sdk-logs",Ss):cr();this.loggerMetrics=new ys(d)}getLoggerConfig(e){const t=ii(e);let r=this._loggerConfigs.get(t);return r||(r=this._loggerConfigurator(e),this._loggerConfigs.set(t,r),r)}},Cs="unknown",Is=class{constructor(e={}){l(this,"_shutdownOnce"),l(this,"_sharedState");const t={resource:e.resource??fn(),forceFlushTimeoutMillis:e.forceFlushTimeoutMillis??3e4,logRecordLimits:{attributeCountLimit:e.logRecordLimits?.attributeCountLimit??128,attributeValueLengthLimit:e.logRecordLimits?.attributeValueLengthLimit??1/0},loggerConfigurator:e.loggerConfigurator??si,processors:e.processors??[],meterProvider:e.meterProvider};this._sharedState=new Ls(t.resource,t.forceFlushTimeoutMillis,t.logRecordLimits,t.processors,t.loggerConfigurator,t.meterProvider),this._shutdownOnce=new Wt(this._shutdown,this)}getLogger(e,t,r){if(this._shutdownOnce.isCalled)return S.warn("A shutdown LoggerProvider cannot provide a Logger"),xe();e||S.warn("Logger requested without instrumentation scope name.");const s={name:e||Cs,version:t,schemaUrl:r?.schemaUrl,...Es(this._sharedState.logRecordLimits,r?.attributes)},a=ii(s);return this._sharedState.loggers.has(a)||this._sharedState.loggers.set(a,new ws(s,this._sharedState)),this._sharedState.loggers.get(a)}forceFlush(){return this._shutdownOnce.isCalled?(S.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(S.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}},Ns=class{export(e,t){this._sendLogRecords(e,t)}async forceFlush(){}async shutdown(){}_exportInfo(e){return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationScope,timestamp:Rr(e.hrTime),traceId:e.spanContext?.traceId,spanId:e.spanContext?.spanId,traceFlags:e.spanContext?.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,eventName:e.eventName,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(const r of e)console.dir(this._exportInfo(r),{depth:3});t?.({code:te.SUCCESS})}},oi=class{constructor(e){l(this,"_exporter"),l(this,"_shutdownOnce"),l(this,"_unresolvedExports"),this._exporter=e,this._shutdownOnce=new Wt(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e,t){if(this._shutdownOnce.isCalled)return;const r=()=>ln._export(this._exporter,[e]).then(n=>{n.code!==te.SUCCESS&&Ge(n.error??new Error(`SimpleLogRecordProcessor: log record export failed (status ${n})`))}).catch(Ge);if(e.resource.asyncAttributesPending){const n=e.resource.waitForAsyncAttributes?.().then(()=>(this._unresolvedExports.delete(n),r()),Ge);n!=null&&this._unresolvedExports.add(n)}else r()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};async function Ps(e){const t=[];for(let r=0,n=e.length;r0&&await Promise.all(t)}var ai=class{constructor(e,t,r){l(this,"_exportCompleted"),l(this,"_exportScheduledPromise"),l(this,"_exportScheduledResolve"),this._exportScheduledPromise=new Promise(n=>{this._exportScheduledResolve=n}),this._exportCompleted=this._executeExport(e,t,r)}get exportCompleted(){return this._exportCompleted}get exportScheduled(){return this._exportScheduledPromise}async _executeExport(e,t,r){try{await Ps(t),await Re.with(Er(Re.active()),async()=>this._exportWithTimeout(e,t,r))}catch(n){Ge(n),this._exportScheduledResolve()}}async _exportWithTimeout(e,t,r){return new Promise((n,s)=>{const a=setTimeout(()=>{s(new Error("Timeout"))},r);e.export(t,d=>{clearTimeout(a),d.code===te.SUCCESS?n():s(d.error??new Error("BatchLogRecordProcessor: log record export failed"))}),this._exportScheduledResolve()})}},xs=class{constructor(e,t){l(this,"_maxExportBatchSize"),l(this,"_maxQueueSize"),l(this,"_scheduledDelayMillis"),l(this,"_exportTimeoutMillis"),l(this,"_exporter"),l(this,"_currentExport",null),l(this,"_finishedLogRecords",[]),l(this,"_timer"),l(this,"_shutdownOnce"),l(this,"_flushing",!1),this._exporter=e,this._maxExportBatchSize=t?.maxExportBatchSize??512,this._maxQueueSize=t?.maxQueueSize??2048,this._scheduledDelayMillis=t?.scheduledDelayMillis??5e3,this._exportTimeoutMillis=t?.exportTimeoutMillis??3e4,this._shutdownOnce=new Wt(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(S.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}async _flushAll(){if(this._flushing)return;this._flushing=!0;let e=this._finishedLogRecords;this._finishedLogRecords=[],this._clearTimer();const t=this._currentExport;for(t!==null&&(await this._exporter.forceFlush(),await t.exportCompleted,this._currentExport=null);e.length>0;){let r;e.length<=this._maxExportBatchSize?(r=e,e=[]):r=e.splice(0,this._maxExportBatchSize);const n=new ai(this._exporter,r,this._exportTimeoutMillis);this._currentExport=n;try{await n.exportScheduled,await this._exporter.forceFlush(),await n.exportCompleted}catch(s){Ge(s)}finally{this._currentExport=null}}this._flushing=!1,this._maybeStartTimer()}_extractBatch(){if(this._finishedLogRecords.length===0)return null;if(this._finishedLogRecords.length<=this._maxExportBatchSize){const e=this._finishedLogRecords;return this._finishedLogRecords=[],e}else return this._finishedLogRecords.splice(0,this._maxExportBatchSize)}_exportOneBatch(){this._clearTimer();const e=this._extractBatch();if(e===null)return;const t=new ai(this._exporter,e,this._exportTimeoutMillis);this._currentExport=t,t.exportCompleted.then(()=>{this._currentExport=null,this._maybeStartTimer()}).catch(r=>{this._currentExport=null,Ge(r),this._maybeStartTimer()})}_maybeStartTimer(){if(!this._shutdownOnce.isCalled&&!this._flushing&&this._finishedLogRecords.length!==0&&this._currentExport===null){if(this._finishedLogRecords.length>=this._maxExportBatchSize){this._exportOneBatch();return}this._timer===void 0&&(this._timer=setTimeout(()=>{this._timer=void 0,this._exportOneBatch()},this._scheduledDelayMillis),typeof this._timer!="number"&&this._timer.unref())}}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}},Ds=class extends xs{constructor(e,t){super(e,t),l(this,"_visibilityChangeListener"),l(this,"_pageHideListener"),this._onInit(t)}onShutdown(){typeof document>"u"||(this._visibilityChangeListener&&document.removeEventListener("visibilitychange",this._visibilityChangeListener),this._pageHideListener&&document.removeEventListener("pagehide",this._pageHideListener))}_onInit(e){e?.disableAutoFlushOnDocumentHide===!0||typeof document>"u"||(this._visibilityChangeListener=()=>{document.visibilityState==="hidden"&&this.forceFlush()},this._pageHideListener=()=>{this.forceFlush()},document.addEventListener("visibilitychange",this._visibilityChangeListener),document.addEventListener("pagehide",this._pageHideListener))}},ci="@sqs/otel-browser",ui="1.2.1",Ms="https://tracing.squarespace.com/v1/logs",Us="e1ec9bfa9564fc716d5a4cf5c16ac580",Fs="8c0072d91b0e97827988089104c60fdf",ks=e=>e==="prod"?Fs:Us,di="sqsp.a11y.page_load",li="pagehide",hi="visibilitychange",Bs=["Tab","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp"," ","Enter"],Vs=["more","less","custom"],Hs=()=>Vs.find(e=>window.matchMedia(`(prefers-contrast: ${e})`).matches)??"no-preference",Gs=()=>({forceColors:window.matchMedia("(forced-colors: active)").matches,networkInformationType:navigator.connection?.type,prefersContrast:Hs(),prefersReducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,primaryInputHasHover:window.matchMedia("(hover: hover)").matches,keyboardUsage:!1}),Ws=()=>{const e=Gs();let t=!1;const r=s=>{const a=s.target,d=a instanceof HTMLElement?a.tagName:"";["INPUT","TEXTAREA"].includes(d)||a instanceof HTMLElement&&a.isContentEditable||!Bs.includes(s.key)||(e.keyboardUsage=!0,document.removeEventListener("keydown",r))},n=()=>{t||(t=!0,x.getLogger(ci,ui).emit({eventName:di,severityNumber:J.INFO,severityText:"INFO",body:{...e},attributes:{"event.name":di,"sqsp.signal":"a11y.page_load","sqsp.a11y.force_colors":e.forceColors,"sqsp.a11y.prefers_contrast":e.prefersContrast,"sqsp.a11y.prefers_reduced_motion":e.prefersReducedMotion,"sqsp.a11y.primary_input_has_hover":e.primaryInputHasHover,"sqsp.a11y.keyboard_usage":e.keyboardUsage}}),document.removeEventListener("keydown",r))};return document.addEventListener("keydown",r),n},xr=e=>{const t=Number(e);return Number.isFinite(t)?t:void 0},zs=(e={})=>Object.entries(e).reduce((t,[r,n])=>(n!==null&&(t[`sqsp.context.${r}`]=n),t),{}),js=({serviceName:e,serviceVersion:t,environment:r,attributes:n,context:s})=>{const a=navigator.connection;return{"page.load.id":crypto.randomUUID(),"service.name":e,"service.version":t,"deployment.environment.name":r,"telemetry.sdk.name":ci,"telemetry.sdk.version":ui,"host.name":window.location.hostname,"url.domain":window.location.hostname,"url.path":window.location.pathname||"/","browser.viewport.width":window.innerWidth,"browser.viewport.height":window.innerHeight,"browser.screen.width":window.screen.width,"browser.screen.height":window.screen.height,"browser.device_pixel_ratio":window.devicePixelRatio,"browser.network.downlink":xr(a?.downlink),"browser.network.effective_type":a?.effectiveType,"browser.network.rtt":xr(a?.rtt),"browser.network.save_data":a?.saveData,"browser.device.memory":xr(navigator.deviceMemory),"browser.hardware_concurrency":xr(navigator.hardwareConcurrency),...zs(s),...n}},$s=e=>{if(!e)return Ms;const t=e.trim();if(t.endsWith("/v1/logs"))return t;let r=t.length;for(;r>0&&t[r-1]==="/";)r--;return`${t.slice(0,r)}/v1/logs`},qs=[/^localhost$/i,/^127\./,/^0\.0\.0\.0$/,/^::1$/,/\.local$/i,/\.test$/i,/\.qa\./i,/(^|\.)qa-/i,/\.staging\./i,/(^|\.)staging-/i,/\.sqsp\.net$/i],gi=(e=globalThis.location?.hostname??"")=>qs.some(t=>t.test(e))?"dev":"prod",ht="0.5.2",Ce;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Ce||(Ce={}));var _i=class{emit(e){}enabled(){return!1}},Ys=new _i,Dr=Symbol.for("io.opentelemetry.js.api.logs"),Kt=globalThis;function Ks(e,t,r){return n=>n===e?t:r}var mi=1,Qs=class{getLogger(e,t,r){return new _i}},fi=new Qs,Xs=class{constructor(e,t,r,n){this._provider=e,this.name=t,this.version=r,this.options=n}emit(e){this._getLogger().emit(e)}enabled(e){return this._getLogger().enabled(e)}_getLogger(){if(this._delegate)return this._delegate;const e=this._provider._getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Ys}},pi=class{getLogger(e,t,r){var n;return(n=this._getDelegateLogger(e,t,r))!==null&&n!==void 0?n:new Xs(this,e,t,r)}_getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:fi}_setDelegate(e){this._delegate=e}_getDelegateLogger(e,t,r){var n;return(n=this._delegate)===null||n===void 0?void 0:n.getLogger(e,t,r)}},Zs=class as{constructor(){this._proxyLoggerProvider=new pi}static getInstance(){return this._instance||(this._instance=new as),this._instance}setGlobalLoggerProvider(t){return Kt[Dr]?this.getLoggerProvider():(Kt[Dr]=Ks(mi,t,fi),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,r;return(r=(t=Kt[Dr])===null||t===void 0?void 0:t.call(Kt,mi))!==null&&r!==void 0?r:this._proxyLoggerProvider}getLogger(t,r,n){return this.getLoggerProvider().getLogger(t,r,n)}disable(){delete Kt[Dr],this._proxyLoggerProvider=new pi}},Js=Zs.getInstance(),X=console.error.bind(console);function Qt(e,t,r){const n=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:n,writable:!0,value:r})}var xn=(e,t,r)=>{if(!e||!e[t]){X("no original function "+String(t)+" to wrap");return}if(!r){X("no wrapper function"),X(new Error().stack);return}const n=e[t];if(typeof n!="function"||typeof r!="function"){X("original object and wrapper must be functions");return}const s=r(n,t);return Qt(s,"__original",n),Qt(s,"__unwrap",()=>{e[t]===s&&Qt(e,t,n)}),Qt(s,"__wrapped",!0),Qt(e,t,s),s},vi=(e,t,r)=>{if(e)Array.isArray(e)||(e=[e]);else{X("must provide one or more modules to patch"),X(new Error().stack);return}if(!(t&&Array.isArray(t))){X("must provide one or more functions to wrap on modules");return}e.forEach(n=>{t.forEach(s=>{xn(n,s,r)})})},Dn=(e,t)=>{if(!e||!e[t]){X("no function to unwrap."),X(new Error().stack);return}const r=e[t];if(!r.__unwrap)X("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{r.__unwrap();return}},Ei=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{X("must provide one or more modules to patch"),X(new Error().stack);return}if(!(t&&Array.isArray(t))){X("must provide one or more functions to unwrap on modules");return}e.forEach(r=>{t.forEach(n=>{Dn(r,n)})})};function Mr(e){e&&e.logger&&(typeof e.logger!="function"?X("new logger isn't a function, not replacing"):X=e.logger)}Mr.wrap=xn,Mr.massWrap=vi,Mr.unwrap=Dn,Mr.massUnwrap=Ei;var eo=class{constructor(e,t,r){l(this,"_config",{}),l(this,"_tracer"),l(this,"_meter"),l(this,"_logger"),l(this,"_diag"),l(this,"instrumentationName"),l(this,"instrumentationVersion"),l(this,"_wrap",xn),l(this,"_unwrap",Dn),l(this,"_massWrap",vi),l(this,"_massUnwrap",Ei),this.instrumentationName=e,this.instrumentationVersion=t,this.setConfig(r),this._diag=S.createComponentLogger({namespace:e}),this._tracer=Xe.getTracer(e,t),this._meter=ye.getMeter(e,t),this._logger=Js.getLogger(e,t),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){const e=this.init()??[];return Array.isArray(e)?e:[e]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config={enabled:!0,...e}}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,t,r,n){if(e)try{e(r,n)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:t},s)}}},gt=class extends eo{constructor(e,t,r){super(e,t,r),this._config.enabled&&this.enable()}};function Mn(e,t,r){let n,s;try{s=e()}catch(a){n=a}finally{if(t(n,s),n&&!r)throw n;return s}}var to="exception",ro=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/errors",ht,e)}init(){return[]}enable(){this._isEnabled||(this._isEnabled=!0,this._onErrorHandler=e=>this._onError(e),window.addEventListener("error",this._onErrorHandler),window.addEventListener("unhandledrejection",this._onErrorHandler))}disable(){this._isEnabled&&(this._isEnabled=!1,this._onErrorHandler&&(window.removeEventListener("error",this._onErrorHandler),window.removeEventListener("unhandledrejection",this._onErrorHandler),this._onErrorHandler=void 0))}_onError(e){const t="reason"in e?e.reason:e.error;if(t==null)return;let r;typeof t=="string"?r={[Se]:t}:r={[Ze]:t.name,[Se]:t.message,[ct]:t.stack};const n=this._applyCustomAttributes(t),s={eventName:to,severityNumber:Ce.ERROR,attributes:{...r,...n}};this.logger.emit(s)}_applyCustomAttributes(e){const t=this.getConfig().applyCustomAttributes;if(!t)return{};let r={};return Mn(()=>{r=t(e)},n=>{n&&this._diag.error("applyCustomAttributes hook failed",n)},!0),r}},Ti="browser.navigation",wi="url.full",Ai="browser.navigation.same_document",bi="browser.navigation.hash_change",no="browser.navigation.type";function io(e,t){try{const r=new URL(e,window.location.origin),n=new URL(t,window.location.origin),s=r.origin===n.origin&&r.pathname===n.pathname&&r.search===n.search,a=r.hash!=="",d=n.hash!=="",_=r.hash!==n.hash;return s&&_&&(a&&d||!a&&d)}catch{const r=e.split("#")[0],n=t.split("#")[0],s=e.split("#")[1]??"",a=t.split("#")[1]??"";return r===n&&s!==a&&a!==""}}var so=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/navigation",ht,e),this._lastUrl=location.href}init(){return[]}enable(){if(this._isEnabled)return;this._isEnabled=!0;const e=this._getNavigationApi();!e&&!this._isHistoryPatched&&(this._patchHistoryApi(),this._isHistoryPatched=!0),this._waitForPageLoad(),e?(this._onCurrentEntryChange=t=>{this._onSoftNavigation("currententrychange",t)},e.addEventListener("currententrychange",this._onCurrentEntryChange)):(this._onPopState=()=>{this._onSoftNavigation("popstate")},window.addEventListener("popstate",this._onPopState))}disable(){this._isEnabled&&(this._isEnabled=!1,this._onDOMContentLoaded&&(document.removeEventListener("DOMContentLoaded",this._onDOMContentLoaded),this._onDOMContentLoaded=void 0),this._onPopState&&(window.removeEventListener("popstate",this._onPopState),this._onPopState=void 0),this._onCurrentEntryChange&&(this._getNavigationApi()?.removeEventListener("currententrychange",this._onCurrentEntryChange),this._onCurrentEntryChange=void 0),this._hasProcessedInitialLoad=!1)}_getNavigationApi(){if(this.getConfig().useNavigationApiIfAvailable)return window.navigation}_onHardNavigation(){const e=this.getConfig(),t={eventName:Ti,severityNumber:Ce.INFO,attributes:{[wi]:e.sanitizeUrl?e.sanitizeUrl(document.documentURI):document.documentURI,[Ai]:!1,[bi]:!1}};this._applyCustomLogRecordData(t),this.logger.emit(t)}_onSoftNavigation(e,t){const r=this._lastUrl,n=e==="currententrychange"&&t?.target?.currentEntry?.url?t.target.currentEntry.url:location.href;if(r===n)return;const s=this._mapChangeStateToType(e,t),a=this._determineSameDocument(r,n),d=io(r,n),_=this.getConfig(),m={eventName:Ti,severityNumber:Ce.INFO,attributes:{[wi]:_.sanitizeUrl?_.sanitizeUrl(n):n,[Ai]:a,[bi]:d,...s?{[no]:s}:{}}};this._applyCustomLogRecordData(m),this.logger.emit(m),this._lastUrl=n}_waitForPageLoad(){if(document.readyState==="complete"&&!this._hasProcessedInitialLoad){this._hasProcessedInitialLoad=!0,this._onHardNavigation();return}this._onDOMContentLoaded=()=>{this._hasProcessedInitialLoad||(this._hasProcessedInitialLoad=!0,this._onHardNavigation())},document.addEventListener("DOMContentLoaded",this._onDOMContentLoaded)}_patchHistoryApi(){this._wrap(history,"replaceState",this._patchHistoryMethod("replaceState")),this._wrap(history,"pushState",this._patchHistoryMethod("pushState"))}_patchHistoryMethod(e){const t=this;return r=>function(...s){if(!t._isEnabled)return r.apply(this,s);const a=r.apply(this,s);return location.href!==t._lastUrl&&t._onSoftNavigation(e),a}}_applyCustomLogRecordData(e){const t=this.getConfig().applyCustomLogRecordData;t&&Mn(()=>t(e),r=>{r&&this._diag.error("applyCustomLogRecordData hook failed",r)},!0)}_determineSameDocument(e,t){try{const r=new URL(e),n=new URL(t);return r.origin===n.origin}catch{return!0}}_mapChangeStateToType(e,t){if(e==="currententrychange")switch(t?.navigationType){case"traverse":return"traverse";case"replace":return"replace";case"reload":return"reload";default:return"push"}switch(e){case"pushState":return"push";case"replaceState":return"replace";case"popstate":return"traverse";default:return}}},oo="browser.navigation_timing",ao="browser.navigation_timing.type",co="url.full",uo="browser.navigation_timing.dom_complete",lo="browser.navigation_timing.dom_content_loaded_event_end",ho="browser.navigation_timing.dom_content_loaded_event_start",go="browser.navigation_timing.dom_interactive",_o="browser.navigation_timing.load_event_end",mo="browser.navigation_timing.load_event_start",fo="browser.navigation_timing.redirect_count",po="browser.navigation_timing.unload_event_end",vo="browser.navigation_timing.unload_event_start",Eo="browser.resource_timing.duration",To="browser.resource_timing.fetch_start",wo="browser.resource_timing.domain_lookup_start",Ao="browser.resource_timing.domain_lookup_end",bo="browser.resource_timing.connect_start",Ro="browser.resource_timing.connect_end",yo="browser.resource_timing.secure_connection_start",So="browser.resource_timing.request_start",Oo="browser.resource_timing.response_start",Lo="browser.resource_timing.response_end",Co="browser.resource_timing.transfer_size",Io="browser.resource_timing.encoded_body_size",No="browser.resource_timing.decoded_body_size",Po=50,xo=5,Do=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/navigation-timing",ht,e),l(this,"_lastEntry"),l(this,"_completeDelayTimeoutId"),l(this,"_retryCount",0),l(this,"_didEmit",!1)}init(){return[]}enable(){this._isEnabled||(this._isEnabled=!0,this._onLoad=()=>this._tryEmitOrSchedule(),this._onPageHide=()=>this._handleUnload(),this._tryEmitOrSchedule(),!this._didEmit&&window.addEventListener("pagehide",this._onPageHide))}disable(){this._isEnabled=!1,this._unsubscribeAll(),this._lastEntry=void 0,this._didEmit=!1,this._retryCount=0}_getLatestNavigationEntry(){const e=performance?.getEntriesByType?.("navigation");if(!(!e||e.length===0))return e[e.length-1]}_calculateBackoffDelay(){return this._retryCount*Po}_tryEmitOrSchedule(){if(this._didEmit)return;const e=this._getLatestNavigationEntry();if(e&&(this._lastEntry=e),e&&e.loadEventEnd>0){this._emitAndCleanup(e);return}if(document.readyState!=="complete"){window.addEventListener("load",this._onLoad,{once:!0});return}if(this._completeDelayTimeoutId!==void 0)return;if(this._retryCount>xo){this._lastEntry?(this._diag.warn("Navigation timing: retries exhausted, emitting incomplete entry"),this._emitAndCleanup(this._lastEntry)):(this._diag.warn("Navigation timing: retries exhausted with no entry available"),this._unsubscribeAll());return}const t=this._calculateBackoffDelay();this._retryCount++,this._completeDelayTimeoutId=window.setTimeout(()=>{this._completeDelayTimeoutId=void 0,this._tryEmitOrSchedule()},t)}_handleUnload(){if(this._didEmit)return;const e=this._getLatestNavigationEntry()??this._lastEntry;e?this._emitAndCleanup(e):(this._diag.warn("Navigation timing: no entry available at unload"),this._unsubscribeAll())}_emitAndCleanup(e){this._didEmit||(this._didEmit=!0,this._emitNavigationTiming(e),this._lastEntry=void 0,this._unsubscribeAll())}_emitNavigationTiming(e){e&&this.logger.emit({eventName:oo,severityNumber:Ce.INFO,attributes:{[ao]:e.type,[co]:e.name,[Eo]:e.duration,[uo]:e.domComplete,[lo]:e.domContentLoadedEventEnd,[ho]:e.domContentLoadedEventStart,[go]:e.domInteractive,[_o]:e.loadEventEnd,[mo]:e.loadEventStart,[fo]:e.redirectCount,[po]:e.unloadEventEnd,[vo]:e.unloadEventStart,[To]:e.fetchStart,[wo]:e.domainLookupStart,[Ao]:e.domainLookupEnd,[bo]:e.connectStart,[Ro]:e.connectEnd,[yo]:e.secureConnectionStart,[So]:e.requestStart,[Oo]:e.responseStart,[Lo]:e.responseEnd,[Co]:e.transferSize,[Io]:e.encodedBodySize,[No]:e.decodedBodySize}})}_unsubscribeAll(){this._completeDelayTimeoutId&&(clearTimeout(this._completeDelayTimeoutId),this._completeDelayTimeoutId=void 0),this._onLoad&&window.removeEventListener("load",this._onLoad),this._onPageHide&&window.removeEventListener("pagehide",this._onPageHide)}},Mo=50,Uo=typeof window.requestIdleCallback=="function";function Fo(e,t){return Uo?{id:window.requestIdleCallback(e,t),native:!0}:{id:window.setTimeout(()=>{const r=performance.now();e({didTimeout:!1,timeRemaining:()=>Math.max(0,Mo-(performance.now()-r))})},1),native:!1}}function ko(e){e.native?window.cancelIdleCallback(e.id):clearTimeout(e.id)}var Bo="browser.resource_timing",Vo="url.full",Ho="browser.resource_timing.initiator_type",Go="browser.resource_timing.duration",Wo="browser.resource_timing.fetch_start",zo="browser.resource_timing.domain_lookup_start",jo="browser.resource_timing.domain_lookup_end",$o="browser.resource_timing.connect_start",qo="browser.resource_timing.connect_end",Yo="browser.resource_timing.secure_connection_start",Ko="browser.resource_timing.request_start",Qo="browser.resource_timing.response_start",Xo="browser.resource_timing.response_end",Zo="browser.resource_timing.transfer_size",Jo="browser.resource_timing.encoded_body_size",ea="browser.resource_timing.decoded_body_size",ta="browser.resource_timing.redirect_start",ra="browser.resource_timing.redirect_end",na="browser.resource_timing.worker_start",ia="browser.resource_timing.next_hop_protocol",sa="browser.resource_timing.render_blocking_status",oa=50,aa=1e3,ca=50,ua=1e3,da=1,la=0,ha=0,ga=1,_a=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/resource-timing",ht,e),l(this,"_observer"),l(this,"_pendingEntries",[]),l(this,"_idleHandle")}init(){return[]}enable(){if(!this._isEnabled){if(!("PerformanceObserver"in window)){this._diag.debug("PerformanceObserver is not supported, resource timings will not be collected");return}this._isEnabled=!0,document.readyState==="complete"?this._setupObserver():(this._loadHandler=()=>this._setupObserver(),window.addEventListener("load",this._loadHandler,{once:!0})),this._visibilityChangeHandler=()=>{document.hidden&&this._flush()},document.addEventListener("visibilitychange",this._visibilityChangeHandler)}}disable(){this._isEnabled=!1,this._flush(),this._observer?.disconnect(),this._observer=void 0,this._loadHandler&&(window.removeEventListener("load",this._loadHandler),this._loadHandler=void 0),this._visibilityChangeHandler&&(document.removeEventListener("visibilitychange",this._visibilityChangeHandler),this._visibilityChangeHandler=void 0)}_setupObserver(){if(!this._isEnabled)return;const e=new PerformanceObserver(t=>{if(!this._isEnabled)return;const r=Math.max(this._config.maxQueueSize??ua,ga),n=t.getEntries(),s=this._config.initiatorTypes;for(const a of n){if(s!==void 0&&!s.includes(a.initiatorType))continue;let d;try{d=cn(a.name,this._config.ignoreUrls)}catch(_){this._diag.error("Failed to check ignoreUrls for resource entry",_);continue}d||(this._pendingEntries.length>=r&&this._flush(),this._pendingEntries.push(a))}this._pendingEntries.length>0&&this._scheduleProcessing()});this._observer=e;try{e.observe({type:"resource",buffered:!0})}catch(t){this._diag.error("Failed to start resource PerformanceObserver",t),this._observer=void 0}}_scheduleProcessing(){if(this._idleHandle!==void 0)return;const e=Math.max(this._config.forceProcessingAfter??aa,la);this._idleHandle=Fo(t=>this._processChunk(t),{timeout:e})}_processChunk(e){if(this._idleHandle=void 0,!this._isEnabled||this._pendingEntries.length===0)return;const t=Math.max(this._config.maxProcessingTime??ca,ha),r=Math.max(this._config.batchSize??oa,da),n=performance.now();let s=0;try{for(let a=0;a=t||e.timeRemaining()<1)break;s++,this._emitResource(d)}}finally{this._pendingEntries.splice(0,s),this._pendingEntries.length>0&&this._scheduleProcessing()}}_emitResource(e){try{this.logger.emit({eventName:Bo,severityNumber:Ce.INFO,attributes:{[Vo]:e.name,[Ho]:e.initiatorType,[Go]:e.duration,[Wo]:e.fetchStart,[zo]:e.domainLookupStart,[jo]:e.domainLookupEnd,[$o]:e.connectStart,[qo]:e.connectEnd,[Yo]:e.secureConnectionStart,[Ko]:e.requestStart,[Qo]:e.responseStart,[Xo]:e.responseEnd,[Zo]:e.transferSize,[Jo]:e.encodedBodySize,[ea]:e.decodedBodySize,[ta]:e.redirectStart,[ra]:e.redirectEnd,[na]:e.workerStart,[ia]:e.nextHopProtocol,[sa]:e.renderBlockingStatus}})}catch(t){this._diag.error(`Failed to emit resource timing entry for "${e.name}"`,t)}}_flush(){this._cancelScheduledProcessing();for(const e of this._pendingEntries)this._emitResource(e);this._pendingEntries=[]}_cancelScheduledProcessing(){this._idleHandle!==void 0&&(ko(this._idleHandle),this._idleHandle=void 0)}},Ri=(e,{useIdForTargetElement:t=!1,useIdForAncestors:r=!1}={})=>{if(e.nodeType===Node.DOCUMENT_NODE)return"";const n=e,s=ma(n,t||r);if(s.startsWith("#"))return s;const a=n.parentElement,d=a?Ri(a,{useIdForAncestors:r,useIdForTargetElement:!1}):"";return d?`${d} > ${s}`:s},ma=(e,t=!1)=>{if(e.nodeType!==Node.ELEMENT_NODE)return"";const r=e,n=r.getAttribute("id");if(t&&n&&r.ownerDocument.querySelectorAll(`#${CSS.escape(n)}`).length===1)return`#${CSS.escape(n)}`;let s=Un(r);const a=fa(r);return a>0&&(s+=`:nth-child(${a})`),s},fa=e=>{if(!e.parentElement)return 0;const t=Un(e),r=Array.from(e.parentElement.children).filter(n=>Un(n)===t);return r.length>1?r.indexOf(e)+1:0},Un=e=>e.localName+(e.classList.length>0?Array.from(e.classList).map(t=>`.${CSS.escape(t)}`).join(""):""),pa="browser.user_action.click",va="browser.mouse_event.button",Ea="browser.page.x",Ta="browser.page.y",wa="browser.tag_name",Aa="browser.element.attributes",ba="browser.css_selector",Ra=["click"],ya="data-otel-",Sa=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/user-action",ht,e)}init(){return[]}_getMouseButtonFromMouseEvent(e){switch(e.button){case 0:return"left";case 1:return"middle";case 2:return"right";default:return"left"}}onClick(e){const t=e.target;if(!(t instanceof HTMLElement)||t.hasAttribute("disabled"))return;const r=Ri(t,{useIdForTargetElement:!0,useIdForAncestors:!0}),n={};for(const s of t.attributes)s.name.startsWith(ya)&&(n[s.name.slice(10)]=s.value);this.logger.emit({severityNumber:Ce.INFO,eventName:pa,attributes:{[Ea]:e.pageX,[Ta]:e.pageY,[wa]:t.tagName,[Aa]:n,[va]:this._getMouseButtonFromMouseEvent(e),[ba]:r}})}enable(){const e=this._config.autoCapturedActions??Ra;this._onClickHandler||(this._onClickHandler=this.onClick.bind(this)),e.includes("click")&&document.addEventListener("click",this._onClickHandler,!0)}disable(){this._onClickHandler&&document.removeEventListener("click",this._onClickHandler,!0)}},Oa="browser.web_vital",La="browser.web_vital.name",Ca="browser.web_vital.value",Ia="browser.web_vital.rating",Na="browser.web_vital.delta",Pa="browser.web_vital.id",xa="browser.web_vital.navigation_type",yi=class{constructor(){l(this,"t"),l(this,"o",0),l(this,"i",[])}u(e){if(e.hadRecentInput)return;const t=this.i[0],r=this.i.at(-1);this.o&&t&&r&&e.startTime-r.startTime<1e3&&e.startTime-t.startTime<5e3?(this.o+=e.value,this.i.push(e)):(this.o=e.value,this.i=[e]),this.t?.(e)}},_t=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart{if(document.readyState==="loading")return"loading";const t=_t();if(t){if(e{const t=e.nodeName;return e.nodeType===1?t.toLowerCase():t.toUpperCase().replace(/^#/,"")},Fn=e=>{let t="";try{for(;e?.nodeType!==9;){const r=e,n=r.id?"#"+r.id:[Da(r),...Array.from(r.classList).sort()].join(".");if(t.length+n.length>99)return t||n;if(t=t?n+">"+t:n,r.id)break;e=r.parentNode}}catch{}return t},Si=new WeakMap;function mt(e,t){let r=Si.get(t);return r||(r=new WeakMap,Si.set(t,r)),r.get(e)||r.set(e,new t),r.get(e)}var Oi=-1,Li=()=>Oi,ft=e=>{addEventListener("pageshow",t=>{t.persisted&&(Oi=t.timeStamp,e(t))},!0)},me=(e,t,r,n)=>{let s,a;return d=>{t.value>=0&&(d||n)&&(a=t.value-(s??0),(a||s===void 0)&&(s=t.value,t.delta=a,t.rating=((_,m)=>_>m[1]?"poor":_>m[0]?"needs-improvement":"good")(t.value,r),e(t)))}},kn=e=>{requestAnimationFrame(()=>requestAnimationFrame(e))},Xt=()=>_t()?.activationStart??0,fe=(e,t=-1)=>{const r=_t();let n="navigate";return Li()>=0?n="back-forward-cache":r&&(document.prerendering||Xt()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},pt=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver(s=>{queueMicrotask(()=>{t(s.getEntries())})});return n.observe({type:e,buffered:!0,...r}),n}}catch{}},Bn=e=>{let t=!1;return()=>{t||(e(),t=!0)}},vt=-1,Ci=new Set,Ii=()=>document.visibilityState!=="hidden"||document.prerendering?1/0:0,Vn=e=>{if(document.visibilityState==="hidden"){if(e.type==="visibilitychange")for(const t of Ci)t();isFinite(vt)||(vt=e.type==="visibilitychange"?e.timeStamp:0,removeEventListener("prerenderingchange",Vn,!0))}},Fr=()=>{if(vt<0){const e=Xt();vt=(document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").find(r=>r.name==="hidden"&&r.startTime>=e)?.startTime)??Ii(),addEventListener("visibilitychange",Vn,!0),addEventListener("prerenderingchange",Vn,!0),ft(()=>{setTimeout(()=>{vt=Ii()})})}return{get firstHiddenTime(){return vt},onHidden(e){Ci.add(e)}}},kr=e=>{document.prerendering?addEventListener("prerenderingchange",e,!0):e()},Ni=[1800,3e3],Pi=(e,t={})=>{kr(()=>{const r=Fr();let n,s=fe("FCP");const a=pt("paint",d=>{for(const _ of d)_.name==="first-contentful-paint"&&(a.disconnect(),_.startTime{s=fe("FCP"),n=me(e,s,Ni,t.reportAllChanges),kn(()=>{s.value=performance.now()-d.timeStamp,n(!0)})}))})},xi=[.1,.25],Di=e=>e.find(t=>t.node?.nodeType===1)||e[0],Ma=(e,t={})=>{const r=mt(t=Object.assign({},t),yi),n=new WeakMap;r.t=s=>{if(s?.sources?.length){const a=Di(s.sources),d=a?.node;if(d){const _=t.generateTarget?.(d)??Fn(d);n.set(a,_)}}},((s,a={})=>{const d=Fr();Pi(Bn(()=>{let _,m=fe("CLS",0);const T=mt(a,yi),E=W=>{for(const w of W)T.u(w);T.o>m.value&&(m.value=T.o,m.entries=T.i,_())},P=pt("layout-shift",E);P&&(_=me(s,m,xi,a.reportAllChanges),d.onHidden(()=>{E(P.takeRecords()),_(!0)}),ft(()=>{T.o=0,m=fe("CLS",0),_=me(s,m,xi,a.reportAllChanges),kn(_)}),setTimeout(_))}))})(s=>{e((a=>{let d={};if(a.entries.length){const _=a.entries.reduce((m,T)=>m.value>T.value?m:T);if(_?.sources?.length){const m=Di(_.sources);m&&(d={largestShiftTarget:n.get(m),largestShiftTime:_.startTime,largestShiftValue:_.value,largestShiftSource:m,largestShiftEntry:_,loadState:Ur(_.startTime)})}}return Object.assign(a,{attribution:d})})(s))},t)},Ua=(e,t={})=>{Pi(r=>{e((n=>{let s={timeToFirstByte:0,firstByteToFCP:n.value,loadState:Ur(Li())};if(n.entries.length){const a=_t(),d=n.entries.at(-1);if(a){const _=a.activationStart||0,m=Math.max(0,a.responseStart-_);s={timeToFirstByte:m,firstByteToFCP:n.value-m,loadState:Ur(n.entries[0].startTime),navigationEntry:a,fcpEntry:d}}}return Object.assign(n,{attribution:s})})(r))},t)},Mi=0,Hn=1/0,Br=0,Fa=e=>{for(const t of e)t.interactionId&&(Hn=Math.min(Hn,t.interactionId),Br=Math.max(Br,t.interactionId),Mi=Br?(Br-Hn)/7+1:0)},Gn,Ui=()=>Gn?Mi:performance.interactionCount??0,ka=()=>{"interactionCount"in performance||Gn||(Gn=pt("event",Fa,{durationThreshold:0}))},Fi=0,ki=class{constructor(){l(this,"l",[]),l(this,"h",new Map),l(this,"m"),l(this,"p")}v(){Fi=Ui(),this.l.length=0,this.h.clear()}M(){const e=Math.min(this.l.length-1,Math.floor((Ui()-Fi)/50));return this.l[e]}u(e){if(this.m?.(e),!e.interactionId&&e.entryType!=="first-input")return;const t=this.l.at(-1);let r=this.h.get(e.interactionId);if(r||this.l.length<10||e.duration>t.T){if(r?e.duration>r.T?(r.entries=[e],r.T=e.duration):e.duration===r.T&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],T:e.duration},this.h.set(r.id,r),this.l.push(r)),this.l.sort((n,s)=>s.T-n.T),this.l.length>10){const n=this.l.splice(10);for(const s of n)this.h.delete(s.id)}this.p?.(r)}}},Wn=e=>{const t=globalThis.requestIdleCallback||setTimeout,r=globalThis.cancelIdleCallback||clearTimeout;if(document.visibilityState==="hidden")e();else{const n=Bn(e);let s=-1;const a=()=>{r(s),n()};addEventListener("visibilitychange",a,{once:!0,capture:!0}),s=t(()=>{removeEventListener("visibilitychange",a,{capture:!0}),n()})}},Bi=[200,500],Ba=(e,t={})=>{const r=mt(t=Object.assign({},t),ki);let n=[],s=[],a=0;const d=new WeakMap,_=new WeakMap;let m=!1;const T=()=>{m||(Wn(E),m=!0)},E=()=>{const w=new Set(r.l.map(N=>d.get(N.entries[0]))),L=s.length-10;s=s.filter((N,z)=>z>=L||w.has(N));const I=new Set;for(const N of s){const z=P(N.startTime,N.processingEnd);for(const Ie of z)I.add(Ie)}n=n.filter(N=>N.startTime>a||I.has(N)),m=!1};r.m=w=>{const L=w.startTime+w.duration;let I;a=Math.max(a,w.processingEnd);for(let N=s.length-1;N>=0;N--){const z=s[N];if(Math.abs(L-z.renderTime)<=8){I=z,I.startTime=Math.min(w.startTime,I.startTime),I.processingStart=Math.min(w.processingStart,I.processingStart),I.processingEnd=Math.max(w.processingEnd,I.processingEnd),t.includeProcessedEventEntries!==!1&&I.entries.push(w);break}}I||(I={startTime:w.startTime,processingStart:w.processingStart,processingEnd:w.processingEnd,renderTime:L,entries:t.includeProcessedEventEntries!==!1?[w]:[]},s.push(I)),(w.interactionId||w.entryType==="first-input")&&d.set(w,I),T()},r.p=w=>{if(!_.get(w)){const L=w.entries.find(I=>I.target)?.target;if(L){const I=t.generateTarget?.(L)??Fn(L);_.set(w,I)}else{const I=w.entries.find(N=>N.targetSelector)?.targetSelector;I&&_.set(w,I)}}};const P=(w,L)=>{const I=[];for(const N of n)if(!(N.startTime+N.durationL)break;I.push(N)}return I},W=w=>{const L=w.entries[0],I=d.get(L),N=L.processingStart,z=Math.max(L.startTime+L.duration,N),Ie=Math.min(I.processingEnd,z),Vr=I.entries.sort((j,je)=>j.processingStart-je.processingStart),er=P(L.startTime,Ie),jn=r.h.get(L.interactionId),et={interactionTarget:_.get(jn),interactionType:L.name.startsWith("key")?"keyboard":"pointer",interactionTime:L.startTime,nextPaintTime:z,processedEventEntries:Vr,longAnimationFrameEntries:er,inputDelay:N-L.startTime,processingDuration:Ie-N,presentationDelay:z-Ie,loadState:Ur(L.startTime),longestScript:void 0,totalScriptDuration:void 0,totalStyleAndLayoutDuration:void 0,totalPaintDuration:void 0,totalUnattributedDuration:void 0};return(j=>{if(!j.longAnimationFrameEntries?.length)return;const je=j.interactionTime,$n=j.inputDelay,Xi=j.processingDuration;let qn,Yn,Kn=0,tr=0,Qn=0,Xn=0;for(const Hr of j.longAnimationFrameEntries){tr=tr+Hr.startTime+Hr.duration-Hr.styleAndLayoutStart;for(const Ne of Hr.scripts){const Ji=Ne.startTime+Ne.duration;if(JiXn&&(Yn=Ne.startTime=je+$n+Xi?"presentation-delay":"processing-duration",qn=Ne,Xn=Gr)}}const Zn=j.longAnimationFrameEntries.at(-1),Zi=Zn?Zn.startTime+Zn.duration:0;Zi>=je+$n+Xi&&(Qn=j.nextPaintTime-Zi),qn&&Yn&&(j.longestScript={entry:qn,subpart:Yn,intersectingDuration:Xn}),j.totalScriptDuration=Kn,j.totalStyleAndLayoutDuration=tr,j.totalPaintDuration=Qn,j.totalUnattributedDuration=j.nextPaintTime-je-Kn-tr-Qn})(et),Object.assign(w,{attribution:et})};pt("long-animation-frame",w=>{n=n.concat(w),T()}),((w,L={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const I=Fr();kr(()=>{ka();let N,z=fe("INP");const Ie=mt(L,ki),Vr=jn=>{Wn(()=>{for(const j of jn)Ie.u(j);const et=Ie.M();et&&et.T!==z.value&&(z.value=et.T,z.entries=et.entries,N())})},er=pt("event",Vr,{durationThreshold:L.durationThreshold??40});N=me(w,z,Bi,L.reportAllChanges),er&&(er.observe({type:"first-input",buffered:!0}),I.onHidden(()=>{Vr(er.takeRecords()),N(!0)}),ft(()=>{Ie.v(),z=fe("INP"),N=me(w,z,Bi,L.reportAllChanges)}))})})(w=>{e(W(w))},t)},Vi=class{constructor(){l(this,"m")}u(e){this.m?.(e)}},Hi=[2500,4e3],Va=(e,t={})=>{const r=mt(t=Object.assign({},t),Vi),n=new WeakMap;r.m=s=>{const a=s.element;if(a){const d=t.generateTarget?.(a)??Fn(a);n.set(s,d)}else s.id&&n.set(s,`#${s.id}`)},((s,a={})=>{kr(()=>{const d=Fr();let _,m=fe("LCP");const T=mt(a,Vi),E=W=>{a.reportAllChanges||(W=W.slice(-1));for(const w of W)T.u(w),w.startTime{E(P.takeRecords()),P.disconnect(),_(!0)}),w=L=>{L.isTrusted&&(Wn(W),removeEventListener(L.type,w,{capture:!0}))};for(const L of["keydown","click","visibilitychange"])addEventListener(L,w,{capture:!0});ft(L=>{m=fe("LCP"),_=me(s,m,Hi,a.reportAllChanges),kn(()=>{m.value=performance.now()-L.timeStamp,_(!0)})})}})})(s=>{e((a=>{let d={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadDuration:0,elementRenderDelay:a.value};if(a.entries.length){const _=a.entries.at(-1),m=_.url&&performance.getEntriesByType("resource").find(E=>E.name===_.url);d.target=n.get(_),d.lcpEntry=_,_.url&&(d.url=_.url),m&&(d.lcpResourceEntry=m);const T=_t();if(T){const E=T.activationStart||0,P=Math.max(0,T.responseStart-E),W=Math.max(P,m?(m.requestStart||m.startTime)-E:0),w=Math.min(a.value,Math.max(W,m?m.responseEnd-E:0));d={...d,timeToFirstByte:P,resourceLoadDelay:W-P,resourceLoadDuration:w-W,elementRenderDelay:a.value-w,navigationEntry:T}}}return Object.assign(a,{attribution:d})})(s))},t)},Gi=[800,1800],zn=e=>{document.prerendering?kr(()=>zn(e)):document.readyState!=="complete"?addEventListener("load",()=>zn(e),!0):setTimeout(e)},Ha=(e,t={})=>{((r,n={})=>{let s=fe("TTFB"),a=me(r,s,Gi,n.reportAllChanges);zn(()=>{const d=_t();d&&(s.value=Math.max(d.responseStart-Xt(),0),s.entries=[d],a(!0),ft(()=>{s=fe("TTFB",0),a=me(r,s,Gi,n.reportAllChanges),a(!0)}))})})(r=>{e((n=>{let s={waitingDuration:0,cacheDuration:0,dnsDuration:0,connectionDuration:0,requestDuration:0};if(n.entries.length){const a=n.entries[0],d=a.activationStart||0,_=Math.max((a.workerStart||a.fetchStart)-d,0),m=Math.max(a.domainLookupStart-d,0),T=Math.max(a.connectStart-d,0),E=Math.max(a.connectEnd-d,0);s={waitingDuration:_,cacheDuration:m-_,dnsDuration:T-m,connectionDuration:E-T,requestDuration:n.value-E,navigationEntry:a}}return Object.assign(n,{attribution:s})})(r))},t)},Ga=class extends gt{constructor(e={}){super("@opentelemetry/browser-instrumentation/web-vitals",ht,e),l(this,"_applyCustomLogRecordData"),l(this,"_includeRawAttribution"),this._applyCustomLogRecordData=e.applyCustomLogRecordData,this._includeRawAttribution=e.includeRawAttribution??!1}init(){return[]}enable(){if(typeof PerformanceObserver>"u"){this._diag.debug("PerformanceObserver not supported, web vitals will not be collected");return}if(this._isEnabled=!0,this._listenersRegistered){this._diag.debug("Listeners already registered, resuming emission");return}this._listenersRegistered=!0,this._diag.debug("Registering listeners"),Ma(e=>this._emitWebVital(e)),Ba(e=>this._emitWebVital(e)),Va(e=>this._emitWebVital(e)),Ua(e=>this._emitWebVital(e)),Ha(e=>this._emitWebVital(e))}disable(){this._isEnabled=!1,this._diag.debug("Instrumentation disabled, pausing emission")}_getTimestampForMetric(e){if(e.name==="CLS"){const{attribution:t}=e;return t.largestShiftTime!==void 0?t.largestShiftTime:void 0}if(e.name==="INP"){const{attribution:t}=e;return t.interactionTime}return e.value}_emitWebVital(e){if(!this._isEnabled)return;const t={[La]:e.name.toLowerCase(),[Ca]:e.value,[Na]:e.delta,[Ia]:e.rating,[Pa]:e.id,[xa]:e.navigationType},r=this._getTimestampForMetric(e),n={eventName:Oa,severityNumber:Ce.INFO,attributes:t,...this._includeRawAttribution?{body:JSON.stringify(e.attribution)}:{},...r!==void 0?{timestamp:r}:{}};this._applyCustomLogRecordData&&Mn(()=>this._applyCustomLogRecordData?.(n),s=>{s&&this._diag.error("applyCustomLogRecordData hook failed",s)},!0),this.logger.emit(n)}},Wa=(e={},t=[])=>{const r=[];return e.errors!==!1&&r.push(new ro(e.errors)),e.navigation!==!1&&r.push(new so(e.navigation)),e.navigationTiming!==!1&&r.push(new Do(e.navigationTiming)),e.resourceTiming!==!1&&r.push(new _a(e.resourceTiming)),e.webVitals!==!1&&r.push(new Ga(e.webVitals)),e.userAction&&r.push(new Sa(e.userAction===!0?{}:e.userAction)),[...r,...t]},za=e=>(...t)=>{e?.(...t)},ja=e=>e===void 0||Number.isNaN(e)?1:Math.min(1,Math.max(0,e)),$a=e=>({serviceName:e.serviceName,serviceVersion:e.serviceVersion,environment:e.environment,enabled:typeof e.enabled=="boolean"?e.enabled:!0,endpoint:e.endpoint,sampleRate:ja(e.sampleRate),attributes:e.attributes,context:e.context??{},debug:e.debug===!0,exporters:e.exporters,processors:e.processors,instrumentations:e.instrumentations??{},customInstrumentations:e.customInstrumentations??[],captureException:za(e.captureException),getRouteTemplate:e.getRouteTemplate,resourceTimingSummary:e.resourceTimingSummary}),Wi=8,qa=/^\d+$/,Ya=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Ka=/^[0-9a-f]{16,}$/i,Qa=/^(?=.*\d)[a-z0-9_-]{12,}$/i,Xa=e=>qa.test(e)||Ya.test(e)||Ka.test(e)||Qa.test(e),Za=({path:e})=>{const t=e.split("/").filter(Boolean);if(t.length===0)return"/";const r=t.slice(0,Wi).map(s=>Xa(s)?":id":s),n=t.length>Wi?"/\u2026":"";return`/${r.join("/")}${n}`},Ja=(e,t)=>{let r;try{r=new URL(e)}catch{return e}const n={fullUrl:e,url:r,path:r.pathname||"/"};if(t)try{const s=t(n);if(typeof s=="string"&&s.length>0)return s}catch{}try{return Za(n)??n.path}catch{return n.path}},ec="browser.navigation",tc="browser.resource_timing",rc="browser.resource_timing.summary",nc="browser.web_vital",ic="exception",zi="url.full",ji="browser.navigation.same_document",$i="browser.resource_timing.initiator_type",sc="browser.resource_timing.duration",oc="browser.resource_timing.fetch_start",ac="browser.resource_timing.transfer_size",cc="browser.resource_timing.encoded_body_size",uc="browser.resource_timing.decoded_body_size",dc="browser.resource_timing.render_blocking_status",lc="browser.web_vital.rating",qi="navigation.id",Yi="browser.navigation.index",Ki="browser.route.template",hc="browser.resource_timing.retention_reason",gc="browser.resource_timing.summary.resource_count",_c="browser.resource_timing.summary.transfer_size_sum",mc="browser.resource_timing.summary.encoded_body_size_sum",fc="browser.resource_timing.summary.decoded_body_size_sum",pc="browser.resource_timing.summary.duration_sum",vc="browser.resource_timing.summary.duration_max",Ec="browser.resource_timing.summary.cache_hit_count",Tc="browser.resource_timing.summary.render_blocking_count",wc="browser.resource_timing.summary.third_party_count",Ac="browser.resource_timing.summary.third_party_transfer_size_sum",bc="browser.resource_timing.summary.late_unattributed_count",Rc="browser.resource_timing.summary.heartbeat_seq",yc="browser.resource_timing.summary.window_partial",Sc={detailTopN:5,detailDurationMs:1e3,detailTransferBytes:512e3,detailMaxPerWindow:20,interestingMaxPerWindow:80,heartbeatMs:3e4,windowLingerMs:2e3},Oc=()=>({count:0,transferSizeSum:0,encodedBodySizeSum:0,decodedBodySizeSum:0,durationSum:0,durationMax:0,cacheHitCount:0,renderBlockingCount:0,thirdPartyCount:0,thirdPartyTransferSizeSum:0}),Zt=e=>{const t=Number(e);return Number.isFinite(t)?t:0},Lc=class{constructor(e,t){this.cfg=e,this.targets=t,l(this,"currentWindow",null),l(this,"pendingWindows",[]),l(this,"navigationSeen",!1),l(this,"lingerTimers",new Map),l(this,"heartbeatTimer"),l(this,"capturedResource"),l(this,"capturedScope")}onEmit(e,t){switch(this.capturedResource||(this.capturedResource=e.resource,this.capturedScope=e.instrumentationScope),e.eventName){case ec:this.handleNavigation(e),this.forward(this.targets.sampledTargets,e,t);return;case tc:this.handleResource(e);return;case nc:this.markInterestingIf(e.attributes[lc]==="poor"),this.stampWindow(e),this.forward(this.targets.sampledTargets,e,t);return;case ic:this.markInterestingIf(!0),this.stampWindow(e),this.forward(this.targets.sampledTargets,e,t);return;default:this.stampWindow(e),this.forward(this.targets.sampledTargets,e,t)}}forceFlush(){return this.flushOpenAndPending({partialCurrent:!0}),Promise.all(this.targets.flushTargets.map(e=>e.forceFlush())).then(()=>{})}shutdown(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer);for(const e of this.lingerTimers.values())clearTimeout(e);return this.lingerTimers.clear(),this.flushOpenAndPending({partialCurrent:!1}),this.currentWindow=null,Promise.all(this.targets.flushTargets.map(e=>e.shutdown())).then(()=>{})}enabled(e){return this.targets.flushTargets.some(t=>t.enabled?.(e)??!0)}handleNavigation(e){const t=String(e.attributes[zi]??""),r=!!e.attributes[ji],n=Ja(t,this.cfg.getRouteTemplate),s=this.pathFromUrl(t);if(this.navigationSeen){const a=performance.now(),d=this.currentWindow;d&&(d.closeTime=a,this.pendingWindows.push(d),this.scheduleLingerFlush(d));const _=d?d.index+1:0;this.currentWindow=this.openWindow(_,a,r,n,s)}else{this.navigationSeen=!0;const a=0;this.currentWindow?(this.currentWindow.routeTemplate=n,this.currentWindow.urlPath=s,this.currentWindow.sameDocument=r):this.currentWindow=this.openWindow(0,a,r,n,s)}this.stampWindowAttrs(e,this.currentWindow),this.armHeartbeat()}openWindow(e,t,r,n,s){return{id:crypto.randomUUID(),index:e,sameDocument:r,routeTemplate:n,urlPath:s,openTime:t,closeTime:null,heartbeatSeq:0,stats:new Map,detail:[],lateUnattributedCount:0,interesting:!1}}pathFromUrl(e){try{return new URL(e).pathname||"/"}catch{return e}}isThirdParty(e){try{return new URL(e).host!==location.host}catch{return!1}}handleResource(e){this.currentWindow||(this.currentWindow=this.openWindow(0,0,!1,"/","/"));const t=Zt(e.attributes[oc]),r=this.findWindowFor(t);this.aggregate(r,e)}findWindowFor(e){const t=[...this.pendingWindows,this.currentWindow];for(const n of t){const s=n.closeTime??1/0;if(e>=n.openTime&&e=this.cfg.detailDurationMs||r.transferSize>=this.cfg.detailTransferBytes?s="threshold":e.interesting&&(s="interesting_window"),s){e.detail.length>=n&&this.evictLowestTopN(e),this.pushDetail(e,t,s,r.duration);return}const a=e.detail.filter(_=>_.reason==="top_n");if(a.length=n&&this.evictLowestTopN(e),this.pushDetail(e,t,"top_n",r.duration);return}if(a.length===0)return;const d=a.reduce((_,m)=>m.duration<_.duration?m:_);r.duration>d.duration&&(e.detail.splice(e.detail.indexOf(d),1),this.pushDetail(e,t,"top_n",r.duration))}evictLowestTopN(e){let t=-1,r=1/0;e.detail.forEach((n,s)=>{n.reason==="top_n"&&n.duration=0&&e.detail.splice(t,1)}pushDetail(e,t,r,n){t.setAttribute(hc,r),this.stampWindowAttrs(t,e),e.detail.push({record:t,reason:r,duration:n})}markInterestingIf(e){e&&this.currentWindow&&(this.currentWindow.interesting=!0)}stampWindow(e){this.currentWindow&&this.stampWindowAttrs(e,this.currentWindow)}stampWindowAttrs(e,t){e.setAttribute(qi,t.id),e.setAttribute(Yi,t.index),e.setAttribute(Ki,t.routeTemplate)}scheduleLingerFlush(e){const t=setTimeout(()=>{this.lingerTimers.delete(e.id),this.flushWindow(e,{partial:!1});const r=this.pendingWindows.indexOf(e);r>=0&&this.pendingWindows.splice(r,1)},this.cfg.windowLingerMs);this.lingerTimers.set(e.id,t)}armHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>{const e=this.currentWindow;e&&(e.stats.size>0||e.detail.length>0)&&this.flushWindow(e,{partial:!0})},this.cfg.heartbeatMs)}flushOpenAndPending({partialCurrent:e}){for(const t of[...this.pendingWindows]){const r=this.lingerTimers.get(t.id);r&&(clearTimeout(r),this.lingerTimers.delete(t.id)),this.flushWindow(t,{partial:!1})}this.pendingWindows=[],this.currentWindow&&this.flushWindow(this.currentWindow,{partial:e})}flushWindow(e,{partial:t}){if(!(!this.capturedResource||!this.capturedScope)&&!(e.stats.size===0&&e.detail.length===0)){for(const[r,n]of e.stats){const s=this.buildSummaryRecord(e,r,n,t);this.forward(this.targets.exactTargets,s,void 0)}for(const r of e.detail)this.forward(this.targets.exactTargets,r.record,void 0);t&&(e.stats=new Map,e.detail=[],e.lateUnattributedCount=0,e.heartbeatSeq+=1)}}buildSummaryRecord(e,t,r,n){const s=br();return{hrTime:s,hrTimeObserved:s,resource:this.capturedResource,instrumentationScope:this.capturedScope,severityNumber:J.INFO,severityText:"INFO",eventName:rc,droppedAttributesCount:0,body:{initiatorType:t,resourceCount:r.count,transferSizeSum:r.transferSizeSum,durationSum:r.durationSum,durationMax:r.durationMax,cacheHitCount:r.cacheHitCount},attributes:{[qi]:e.id,[Yi]:e.index,[ji]:e.sameDocument,[Ki]:e.routeTemplate,"url.path":e.urlPath,[$i]:t,[gc]:r.count,[_c]:r.transferSizeSum,[mc]:r.encodedBodySizeSum,[fc]:r.decodedBodySizeSum,[pc]:r.durationSum,[vc]:r.durationMax,[Ec]:r.cacheHitCount,[Tc]:r.renderBlockingCount,[wc]:r.thirdPartyCount,[Ac]:r.thirdPartyTransferSizeSum,[bc]:e.lateUnattributedCount,[Rc]:e.heartbeatSeq,[yc]:n}}}forward(e,t,r){for(const n of e)n.onEmit(t,r)}},Qi={enabled:!1,forceFlush:async()=>{},shutdown:async()=>{}},Jt,Cc=(e,t)=>{const r=[{onEmit(){},forceFlush(){return t(),Promise.resolve()},shutdown(){return t(),Promise.resolve()}}],n=e.sampleRate;if(e.endpoint!==!1){const d=new _s({url:$s(e.endpoint),headers:{"Lightstep-Access-Token":ks(e.environment??gi())}}),_=new Ds(d,{scheduledDelayMillis:3e4,exportTimeoutMillis:1e4});r.push(_)}e.exporters&&e.exporters.forEach(d=>{r.push(new oi(d))}),e.debug&&r.push(new oi(new Ns));const s=[...r,...e.processors??[]];if(Math.random()>=n)return[];if(e.resourceTimingSummary===!1)return s;const a={...Sc,...typeof e.resourceTimingSummary=="object"?e.resourceTimingSummary:{},getRouteTemplate:e.getRouteTemplate};return[new Lc(a,{exactTargets:s,sampledTargets:s,flushTargets:s})]},Ic=async e=>{const t=$a(e);if(!t.enabled)return Qi;Jt?.enabled&&await Jt.shutdown();let r=[];try{const n=t.environment??gi(),s=Sr(js({serviceName:t.serviceName,serviceVersion:t.serviceVersion,environment:n,attributes:t.attributes,context:t.context})),a=Ws(),d=Cc(t,a),_=new Is({resource:s,processors:d});x.setGlobalLoggerProvider(_),r=Wa(t.instrumentations,t.customInstrumentations),ps({instrumentations:r});let m=!1;const T=()=>{m||(m=!0,_.forceFlush())},E=()=>{document.visibilityState==="hidden"&&T()};globalThis.addEventListener(li,T),document.addEventListener(hi,E);const P={enabled:!0,loggerProvider:_,instrumentations:r,forceFlush:()=>_.forceFlush(),shutdown:async()=>{globalThis.removeEventListener(li,T),document.removeEventListener(hi,E),await _.shutdown(),x.disable(),Jt===P&&(Jt=void 0)}};return Jt=P,P}catch(n){return r.forEach(s=>s?.disable()),t.captureException(n,{options:t}),Qi}}}),123659:(function(Pe,ne,$){$.d(ne,{$s:()=>On,B1:()=>mn,L8:()=>Sr,S1:()=>Nr,le:()=>Ln,lv:()=>We});var Z=Object.defineProperty,A=Object.getOwnPropertyNames,l=(i,o)=>function(){return i&&(o=(0,i[A(i)[0]])(i=0)),o},J=(i,o)=>{for(var c in o)Z(i,c,{get:o[c],enumerable:!0})},he,ge=l({"../../node_modules/.pnpm/nanoid@5.0.1/node_modules/nanoid/url-alphabet/index.js"(){"use strict";he="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"}}),xe={};J(xe,{customAlphabet:()=>De,customRandom:()=>ee,nanoid:()=>_e,random:()=>ie,urlAlphabet:()=>he});var ie,ee,De,_e,Me=l({"../../node_modules/.pnpm/nanoid@5.0.1/node_modules/nanoid/index.browser.js"(){"use strict";ge(),ie=i=>crypto.getRandomValues(new Uint8Array(i)),ee=(i,o,c)=>{let u=(2<{let v="";for(;;){let b=c(h),R=h;for(;R--;)if(v+=i[b[R]&u]||"",v.length===p)return v}}},De=(i,o=21)=>ee(i,o,ie),_e=(i=21)=>crypto.getRandomValues(new Uint8Array(i)).reduce((o,c)=>(c&=63,c<36?o+=c.toString(36):c<62?o+=(c-26).toString(36).toUpperCase():c>62?o+="-":o+="_",o),"")}}),pe={};J(pe,{getCumulativeLayoutShift:()=>Ut,getDomainLookup:()=>Fe,getFirstContentfulPaint:()=>en,getFirstInputDelay:()=>Ft,getInteractionToNextPaint:()=>kt,getLargestContentfulPaint:()=>tn,getNavigationTimingType:()=>At,getServerTiming:()=>we,getTcpConnection:()=>G,getTlsNegotiation:()=>bt});var ve="/api/1/performance/records",Ue="load",k="visibilitychange",x=["Tab","ArrowDown","ArrowLeft","ArrowRight","ArrowUp","End","Home","PageDown","PageUp"," ","Enter"],U="SS_MID",B="SS_ANALYTICS_ID",H=3e4,F=/(iPhone|iPod|iPad) OS ((1[0-2])|[2-9])_\d+.*AppleWebKit(?!.*Safari)/i,$e=200,Et="4.14.0",qe=i=>(...o)=>new Promise((c,u)=>{try{i(h=>{c(h)},...o)}catch(h){u(h)}}),tt=i=>qe(setTimeout)(i),se=()=>qe(i=>{const o=c=>{(c.type==="pagehide"||document.visibilityState==="hidden")&&(i(c),removeEventListener("visibilitychange",o,!0),removeEventListener("pagehide",o,!0))};window.addEventListener("visibilitychange",o,!0),window.addEventListener("pagehide",o,!0)})(),rt=i=>{document.readyState==="complete"?window.setTimeout(i,0):window.addEventListener("pageshow",i,{once:!0})},Tt=()=>qe(rt),wt=()=>{const i={entryType:"navigation",startTime:0},o=performance.timing;for(const c in o)if(c!=="navigationStart"&&c!=="toJSON"){const u=Math.max(o[c]-o.navigationStart,0);i[c]=u}return i},Ye=async()=>{await Tt();const[i]=window.performance.getEntriesByType("navigation");return i??wt()},Y=async i=>{const c=(await Ye())[i];if(!(typeof c!="number"||c<0||c>2147483647))return Math.round(c)},Ee=async()=>(await Ye()).serverTiming,Te=async i=>{const c=(await Ye())[i];if(typeof c=="string")return c},oe=(i,o)=>{if(typeof i=="number"&&typeof o=="number"&&i>=o)return i-o},Fe=i=>Promise.all([Y("domainLookupEnd"),Y("domainLookupStart")]).then(([o,c])=>{i({domainLookup:oe(o,c)})}),At=i=>Te("type").then(o=>{i({navigationTimingType:o})}),we=i=>Ee().then(o=>{i({serverTiming:JSON.stringify(o)})}),G=i=>Promise.all([Y("connectEnd"),Y("connectStart")]).then(([o,c])=>{i({tcpConnection:oe(o,c)})}),bt=i=>Promise.all([Y("connectEnd"),Y("secureConnectionStart")]).then(([o,c])=>{i({tlsNegotiation:oe(o,c)})}),g,f,y,O,C,V=-1,K=function(i){addEventListener("pageshow",function(o){o.persisted&&(V=o.timeStamp,i(o))},!0)},le=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},Ae=function(){var i=le();return i&&i.activationStart||0},Q=function(i,o){var c=le(),u="navigate";return V>=0?u="back-forward-cache":c&&(document.prerendering||Ae()>0?u="prerender":document.wasDiscarded?u="restore":c.type&&(u=c.type.replace(/_/g,"-"))),{name:i,value:o===void 0?-1:o,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:u}},ae=function(i,o,c){try{if(PerformanceObserver.supportedEntryTypes.includes(i)){var u=new PerformanceObserver(function(h){Promise.resolve().then(function(){o(h.getEntries())})});return u.observe(Object.assign({type:i,buffered:!0},c||{})),u}}catch{}},ce=function(i,o,c,u){var h,p;return function(v){o.value>=0&&(v||u)&&((p=o.value-(h||0))||h===void 0)&&(h=o.value,o.delta=p,o.rating=(function(b,R){return b>R[1]?"poor":b>R[0]?"needs-improvement":"good"})(o.value,c),i(o))}},rr=function(i){requestAnimationFrame(function(){return requestAnimationFrame(function(){return i()})})},Rt=function(i){var o=function(c){c.type!=="pagehide"&&document.visibilityState!=="hidden"||i(c)};addEventListener("visibilitychange",o,!0),addEventListener("pagehide",o,!0)},nr=function(i){var o=!1;return function(c){o||(i(c),o=!0)}},be=-1,ir=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},nt=function(i){document.visibilityState==="hidden"&&be>-1&&(be=i.type==="visibilitychange"?i.timeStamp:0,Wr())},sr=function(){addEventListener("visibilitychange",nt,!0),addEventListener("prerenderingchange",nt,!0)},Wr=function(){removeEventListener("visibilitychange",nt,!0),removeEventListener("prerenderingchange",nt,!0)},or=function(){return be<0&&(be=ir(),sr(),K(function(){setTimeout(function(){be=ir(),sr()},0)})),{get firstHiddenTime(){return be}}},yt=function(i){document.prerendering?addEventListener("prerenderingchange",function(){return i()},!0):i()},ar=[1800,3e3],cr=function(i,o){o=o||{},yt(function(){var c,u=or(),h=Q("FCP"),p=ae("paint",function(v){v.forEach(function(b){b.name==="first-contentful-paint"&&(p.disconnect(),b.startTimeu.value&&(u.value=h,u.entries=p,c())},b=ae("layout-shift",v);b&&(c=ce(i,u,ur,o.reportAllChanges),Rt(function(){v(b.takeRecords()),c(!0)}),K(function(){h=0,u=Q("CLS",0),c=ce(i,u,ur,o.reportAllChanges),rr(function(){return c()})}),setTimeout(c,0))}))},Ke={passive:!0,capture:!0},Ot=new Date,ke=function(i,o){g||(g=o,f=i,y=new Date,lr(removeEventListener),Lt())},Lt=function(){if(f>=0&&f1e12?new Date:performance.now())-i.timeStamp;i.type=="pointerdown"?(function(c,u){var h=function(){ke(c,u),v()},p=function(){v()},v=function(){removeEventListener("pointerup",h,Ke),removeEventListener("pointercancel",p,Ke)};addEventListener("pointerup",h,Ke),addEventListener("pointercancel",p,Ke)})(o,i):ke(o,i)}},lr=function(i){["mousedown","keydown","touchstart","pointerdown"].forEach(function(o){return i(o,dr,Ke)})},Be=[100,300],Ct=function(i,o){o=o||{},yt(function(){var c,u=or(),h=Q("FID"),p=function(R){R.startTimeo.latency){if(c)c.entries.push(i),c.latency=Math.max(c.latency,i.duration);else{var u={id:i.interactionId,latency:i.duration,entries:[i]};He[u.id]=u,ue.push(u)}ue.sort(function(h,p){return p.latency-h.latency}),ue.splice(10).forEach(function(h){delete He[h.id]})}},Pt=function(i,o){o=o||{},yt(function(){var c;gr();var u,h=Q("INP"),p=function(b){b.forEach(function(M){M.interactionId&&mr(M),M.entryType==="first-input"&&!ue.some(function(q){return q.entries.some(function(re){return M.duration===re.duration&&M.startTime===re.startTime})})&&mr(M)});var R,D=(R=Math.min(ue.length-1,Math.floor(_r()/50)),ue[R]);D&&D.latency!==h.value&&(h.value=D.latency,h.entries=D.entries,u())},v=ae("event",p,{durationThreshold:(c=o.durationThreshold)!==null&&c!==void 0?c:40});u=ce(i,h,Qe,o.reportAllChanges),v&&("PerformanceEventTiming"in window&&"interactionId"in PerformanceEventTiming.prototype&&v.observe({type:"first-input",buffered:!0}),Rt(function(){p(v.takeRecords()),h.value<0&&_r()>0&&(h.value=0,h.entries=[]),u(!0)}),K(function(){ue=[],Nt=hr(),h=Q("INP"),u=ce(i,h,Qe,o.reportAllChanges)}))})},st=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0]},jr=function(i){var o=i.nodeName;return i.nodeType===1?o.toLowerCase():o.toUpperCase().replace(/^#/,"")},$r=function(i,o){var c="";try{for(;i&&i.nodeType!==9;){var u=i,h=u.id?"#"+u.id:jr(u)+(u.classList&&u.classList.value&&u.classList.value.trim()&&u.classList.value.trim().length?"."+u.classList.value.trim().replace(/\s+/g,"."):"");if(c.length+h.length>(o||100)-1)return c||h;if(c=c?h+">"+c:h,u.id)break;i=u.parentNode}}catch{}return c},fr=-1,qr=function(){return fr},pr=function(i){addEventListener("pageshow",function(o){o.persisted&&(fr=o.timeStamp,i(o))},!0)},xt=function(){var i=st();return i&&i.activationStart||0},Re=function(i,o){var c=st(),u="navigate";return qr()>=0?u="back-forward-cache":c&&(document.prerendering||xt()>0?u="prerender":document.wasDiscarded?u="restore":c.type&&(u=c.type.replace(/_/g,"-"))),{name:i,value:o===void 0?-1:o,rating:"good",delta:0,entries:[],id:"v3-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:u}},S=function(i,o,c){try{if(PerformanceObserver.supportedEntryTypes.includes(i)){var u=new PerformanceObserver(function(h){Promise.resolve().then(function(){o(h.getEntries())})});return u.observe(Object.assign({type:i,buffered:!0},c||{})),u}}catch{}},vr=function(i,o,c,u){var h,p;return function(v){o.value>=0&&(v||u)&&((p=o.value-(h||0))||h===void 0)&&(h=o.value,o.delta=p,o.rating=(function(b,R){return b>R[1]?"poor":b>R[0]?"needs-improvement":"good"})(o.value,c),i(o))}},Yr=function(i){requestAnimationFrame(function(){return requestAnimationFrame(function(){return i()})})},Dt=function(i){var o=function(c){c.type!=="pagehide"&&document.visibilityState!=="hidden"||i(c)};addEventListener("visibilitychange",o,!0),addEventListener("pagehide",o,!0)},Kr=function(i){var o=!1;return function(c){o||(i(c),o=!0)}},ye=-1,ot=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},at=function(i){document.visibilityState==="hidden"&&ye>-1&&(ye=i.type==="visibilitychange"?i.timeStamp:0,Qr())},Xe=function(){addEventListener("visibilitychange",at,!0),addEventListener("prerenderingchange",at,!0)},Qr=function(){removeEventListener("visibilitychange",at,!0),removeEventListener("prerenderingchange",at,!0)},Er=function(){return ye<0&&(ye=ot(),Xe(),pr(function(){setTimeout(function(){ye=ot(),Xe()},0)})),{get firstHiddenTime(){return ye}}},Xr=function(i){document.prerendering?addEventListener("prerenderingchange",function(){return i()},!0):i()},ti=null,Tr=[2500,4e3],Mt={},Ge=function(i,o){(function(c,u){u=u||{},Xr(function(){var h,p=Er(),v=Re("LCP"),b=function(M){var q=M[M.length-1];q&&q.startTime{const o=i.getAttribute("elementtiming");if(o!==null)return o;const c=i.tagName;if(c==="IMG"){const u=i.getAttribute("data-loader");if(u!==null)return`unknown-image-component-${u}`;if(i.getAttribute("data-src")!==null)return"unknown-imageloader"}return`unknown-${c}`},Se=i=>{let o="";o+=i.tagName;let c=i,u=-1;do c=c.previousElementSibling,u+=1;while(c!==null);o+="["+u+"]";const h=i.classList.value?.trim().replace(/\s+/g,".");return h&&(o+="."+h),o},ct=i=>i.substring(0,$e-3)+"...",Ze=i=>{let o=Se(i);if(o.length>$e)return ct(o);let c=i.parentElement;for(;c!==null&&c.tagName!=="BODY";){const u="<"+Se(c);if(o+=u,o.length>$e)return ct(o);c=c.parentElement}return o},Jr=i=>{const o=i.attribution.lcpEntry?.element;return{largestContentfulPaint:Math.round(i.value),lcpElementName:o?Zr(o):void 0,lcpElementPath:o?Ze(o):void 0,lcpElementRenderDelay:Math.round(i.attribution.elementRenderDelay),lcpResourceLoadDelay:Math.round(i.attribution.resourceLoadDelay),lcpResourceLoadTime:Math.round(i.attribution.resourceLoadTime),lcpTtfb:Math.round(i.attribution.timeToFirstByte)}},Ut=i=>{St(o=>{i({cumulativeLayoutShift:o.value})},{reportAllChanges:!0})},en=i=>{cr(o=>{i({firstContentfulPaint:Math.round(o.value)})})},Ft=i=>{Ct(o=>{i({firstInputDelay:Math.round(o.value)})})},kt=i=>{Pt(o=>{i({interactionToNextPaint:Math.round(o.value)})})},tn=i=>{Ge(o=>{i(Jr(o))})},Bt=["connectEnd","connectStart","decodedBodySize","domComplete","domContentLoadedEventEnd","domContentLoadedEventStart","domInteractive","encodedBodySize","fetchStart","loadEventEnd","loadEventStart","redirectCount","redirectEnd","redirectStart","responseStart","responseEnd","responseStatus","secureConnectionStart","transferSize","unloadEventEnd","unloadEventStart","workerStart"],Vt=["initiatorType","nextHopProtocol"],wr=(i,o)=>async c=>{try{o({[c]:await i(c)})}catch(u){window?.SQUARESPACE_SENTRY?.captureException?.(u)}};function Ar(i){Object.values(pe).forEach(async o=>{try{await o(i)}catch(c){window?.SQUARESPACE_SENTRY?.captureException?.(c)}}),Bt.forEach(wr(Y,i)),Vt.forEach(wr(Te,i))}var rn=["more","less","custom"],Ht=()=>rn.find(i=>window.matchMedia(`prefers-contrast: ${i}`).matches)??"no-preference",ut=()=>({forceColors:window.matchMedia("(forced-colors: active)").matches,networkInformationType:navigator.connection?.type,prefersContrast:Ht(),prefersReducedMotion:window.matchMedia("(prefers-reduced-motion: reduce)").matches,primaryInputHasHover:window.matchMedia("(hover: hover)").matches,keyboardUsage:!1}),br=i=>{const o=ut(),c=()=>{i(o,"a11y")},u=p=>{["INPUT","TEXTAREA"].includes(p.target?.tagName)||!x.includes(p.key)||(o.keyboardUsage=!0,document.removeEventListener("keydown",u))};document.addEventListener("keydown",u);const h=()=>{document.visibilityState==="hidden"&&(c(),document.removeEventListener("keydown",u),document.removeEventListener(k,h))};document.addEventListener(k,h)};function Gt(i){const o=new RegExp(`(^| )${i}=([^;]+)`),c=document.cookie.match(o);return c?c[2]:""}function nn(){return!!(window.PerformanceMeasure&&window.PerformanceMark)}function Rr(){if(!Object.prototype.hasOwnProperty.call(window,"PerformanceObserver"))return!1;try{const i=new window.PerformanceObserver(()=>null);i.observe({entryTypes:["mark"]}),i.disconnect()}catch{return!1}return!0}function yr(){return typeof window.navigator?.sendBeacon=="function"&&!F.test(window.navigator.userAgent)}var dt=i=>{const o=Number(i);return Number.isNaN(o)?void 0:o};function te(i={}){return{context:i,analyticsId:Gt(B),marketingId:Gt(U),memberId:window.Static?.SQUARESPACE_CONTEXT?.authenticatedAccount?.id,version:Et,downlink:dt(navigator.connection?.downlink),effectiveType:navigator.connection?.effectiveType,rtt:dt(navigator.connection?.rtt),saveData:Number(navigator.connection?.saveData||0),deliveryType:yr()?"beacon":"xhr",devicePixelRatio:window.devicePixelRatio,screenHeight:window.screen.height,screenWidth:window.screen.width,viewportHeight:window.innerHeight,viewportWidth:window.innerWidth,deviceMemory:dt(navigator.deviceMemory),hardwareConcurrency:dt(navigator.hardwareConcurrency),hash:window.location.hash||"",hostname:window.location.hostname||"",pathname:window.location.pathname||"/"}}var sn=async i=>{const o=te(i),c={};return Ar(u=>{Object.assign(c,u)}),await Promise.race([tt(6e4),se()]),{...o,...c}},on=async(i,o)=>{const c=await sn(o);i(c,"page_speed")},an=["media-www.sqspcdn.com","images.squarespace-cdn.com","static1.squarespace.com"],cn=i=>an.some(o=>i.includes(o)),un=i=>i.hasAttribute("data-loader")?2:i.hasAttribute("data-src")?1:0,Wt=(i,o)=>{if(i.hasAttribute("data-image-resolution"))return Number(i.getAttribute("data-image-resolution")?.replace("w",""));const c=o.indexOf("format=");return c!==-1?Number(o.slice(c+7).replace(/w.*/,"")):NaN},dn=(i,o,c)=>{if(c===1&&i instanceof HTMLImageElement&&i.naturalHeight===0){const u=document.querySelector(`div[style*="${o}"]`);if(u)return u}return i},ln=i=>{if(i instanceof HTMLImageElement){const{naturalHeight:h,naturalWidth:p,width:v,height:b}=i;return{naturalHeight:h,naturalWidth:p,width:v,height:b}}const o=i.getBoundingClientRect(),c=Math.floor(o.width);return{naturalHeight:Math.floor(o.height),naturalWidth:c}},hn=async(i,o)=>{const c=Wt(o,i.name),u=un(o),h=o.getAttribute("data-loader"),p=o.getAttribute("elementtiming"),{serverTiming:v,workerTiming:b,...R}=i.toJSON();for(const[q,re]of Object.entries(R))typeof re=="number"&&(R[q]=Math.floor(re));const D=dn(o,i.name,u),M=ln(D);return new Promise(q=>{const re=new IntersectionObserver(Yt=>{Yt.forEach(lt=>{if(lt.target===D)return re.disconnect(),q({visibleOnLoad:lt.isIntersecting,observationTime:Math.floor(lt.time),intersectionRatio:lt.intersectionRatio,squarespaceSize:c,imageType:u,imageLoaderType:h,elementTiming:p,serverTiming:v||[],...M,...R})})});re.observe(D)})},gn=async({resource:i,deliverMetrics:o})=>{if(!(i instanceof PerformanceResourceTiming&&i.initiatorType==="img")||!cn(i.name))return;const c=i.name.replace(/\?.*/,""),u=Array.from(document.querySelectorAll(`img[src="${i.name}"], img[data-src*="${c}"], img[srcset*="${i.name}"]`));if(document.querySelectorAll(`picture > source[srcset*="${i.name}"]`).forEach(p=>{const v=p.parentElement;v!==null&&u.push(v.lastElementChild)}),u.length!==1)return;const h=await hn(i,u[0]);o(h,"image")},_n=async i=>{if(!Rr())return;const o=u=>gn({resource:u,deliverMetrics:i});performance.getEntriesByType("resource").forEach(o),new PerformanceObserver(u=>{u.getEntries().forEach(o)}).observe({entryTypes:["resource"]})},Oe,zt=({spanName:i,tracer:o,startTime:c,spanAttributes:u={}})=>{Oe===void 0&&(Oe=new Map);const h=o.startSpan(i,{startTime:c});h.setAttributes(u),Oe.set(i,h)},Je=({spanName:i,spanAttributes:o={},updateName:c})=>{if(Oe===void 0||!Oe.has(i))return;const u=Oe.get(i);u.setAttributes(o),c!==void 0&&u.updateName(c),u.end(),Oe.delete(i)},We="rum-",ze=i=>{typeof window?.SQUARESPACE_SENTRY?.captureException=="function"?window.SQUARESPACE_SENTRY.captureException(i):console.warn(`@sqs/rum-collector: user timing exception: ${i}`)};function mn(i,o={}){try{if(!jt())return;const c=We+i;window.performance.clearMarks(c);const u=window.performance.mark(c,{detail:o.detail,startTime:o.startTime});if(o.tracer!==void 0){const[h]=window.performance.getEntriesByName(c,"mark").slice(-1);zt({spanName:c,tracer:o.tracer,startTime:h.startTime,spanAttributes:o.spanAttributes})}return u}catch(c){ze(c)}}function Sr(i,o={requireStart:!1}){try{if(!(jt()&&fn()))return;const c=We+i,u={detail:o.detail,duration:o.duration};if(o.start===void 0?window.performance.getEntriesByName(c,"mark").length>0&&(u.start=c):typeof o.start=="string"?u.start=We+o.start:u.start=o.start,u.end=typeof o.end=="string"?We+o.end:o.end,o.requireStart&&typeof u.start!="string")return;if(o.tracer!==void 0){const p={measureName:c,...o.spanAttributes};typeof u.start=="number"?(zt({spanName:c,tracer:o.tracer,startTime:u.start}),Je({spanName:c,spanAttributes:p})):(window.performance.getEntriesByName(u.start??c,"mark").length===0&&zt({spanName:u.start??c,tracer:o.tracer,startTime:0}),Je({spanName:u.start??c,spanAttributes:p,updateName:u.start!==c?c:void 0}))}return vn(c,u),pn(c)}catch(c){ze(c)}}function fn(){return"performance"in window&&"getEntries"in window.performance&&"getEntriesByType"in window.performance&&"getEntriesByName"in window.performance}function jt(){return"mark"in window.performance&&"measure"in window.performance}function pn(i){const o=window.performance.getEntriesByName(i,"measure");return o[o.length-1]}function vn(i,o){try{window.performance.measure(i,o)}catch{const u=typeof o.start=="string"?o.start:i,h=typeof o.end=="string"?o.end:void 0;try{window.performance.measure(i,u,h)}catch(p){if(!(p instanceof DOMException))throw p;try{window.performance.measure(i,"navigationStart")}catch(v){if(!(v instanceof DOMException))throw v;window.performance.measure(i)}}}}function En(i){return typeof i=="string"&&i.substring(0,4)===We}var Or=new Set,$t=i=>{if(!nn())return;const o=c=>{c.map(h=>h.entryType==="measure"?{duration:Math.floor(h.duration),detail:h.detail||null,startTime:Math.floor(h.startTime),name:h.name}:{}).forEach(h=>{if(h.name&&!En(h.name))return;const p=`${h.name}|${h.duration}`;Or.has(p)||(i(h,"user"),Or.add(p))})};o(window.performance.getEntriesByType("measure")),Rr()?new window.PerformanceObserver(u=>o(u.getEntries())).observe({entryTypes:["measure"]}):document.addEventListener(k,()=>{document.visibilityState==="hidden"&&o(window.performance.getEntriesByType("measure"))})},Lr,Le=[],Tn=i=>{Le.push(i)};function wn(i,o){try{return navigator.sendBeacon(i,o)}catch(c){if(c instanceof TypeError&&c.message==="Illegal invocation")return!1;throw c}}function An(i,o){if(yr()&&wn(i,o))return;const c=new XMLHttpRequest;c.open("POST",i,!0),c.setRequestHeader("Content-Type","text/plain;charset=UTF-8"),c.send(o)}function Cr(i){if(Le.length){const o=JSON.stringify(Le);An(i,o),Le=[]}}function ri(i){window.addEventListener(Ue,()=>{Lr=window.setTimeout(()=>Cr(i),H)}),document.addEventListener(k,()=>{document.visibilityState==="hidden"&&(window.clearTimeout(Lr),Cr(i))})}function bn(i){Tn({raw:!0,...i})}var Rn=(i,o)=>(c,u)=>{const h={app:i,data:c,event:u,pageLoadId:o,ts:Date.now()};bn(h)},yn=i=>(...o)=>{i&&i(...o)},Ir=i=>({appName:i.appName||"",context:i.context||{},enabled:typeof i.enabled=="boolean"?i.enabled:!0,serviceURL:i.serviceURL||ve,captureException:yn(i.captureException)});async function Nr(i){const o=Ir(i);if(!o.enabled)return;const c=(await Promise.resolve().then(()=>(Me(),xe))).nanoid();try{const u=Rn(o.appName,c);on(u,o.context),$t(u),_n(u),br(u),ri(o.serviceURL)}catch(u){o.captureException(u,{pageLoadId:c,parsedOptions:o})}}var Sn={action:"load",actor:"user",event_owner_team:"web_performance",event_source:"web",object_type:"website"},qt=()=>{const i=/^qa\d+.sqsp.net/g,o=/^stage.sqsp.net/g,c=/(dev.squarespace.net|localhost|127.0.0.1|0.0.0.0)/g,u=window.location.hostname.substr(window.location.hostname.indexOf(".")+1);return o.test(u)||i.test(u)?"staging":c.test(u)?"dev":"prod"},On=(i,o=qt())=>new i({customSchemaName:"Performance",sourceEnvironment:o},Sn),Pr=Object.freeze({cumulativeLayoutShift:"cumulative_layout_shift",decodedBodySize:"decoded_body_size_bytes",domContentLoadedEventEnd:"dom_content_loaded_event_end_ms",domContentLoadedEventStart:"dom_content_loaded_event_start_ms",domainLookup:"domain_lookup_ms",encodedBodySize:"encoded_body_size_bytes",firstContentfulPaint:"first_contentful_paint_ms",firstInputDelay:"first_input_delay_ms",interactionToNextPaint:"interaction_to_next_paint_ms",largestContentfulPaint:"largest_contentful_paint_ms",loadEventEnd:"load_event_end_ms",loadEventStart:"load_event_start_ms",responseStart:"response_start_ms",tcpConnection:"tcp_connection_ms",tlsNegotiation:"tls_negotiation_ms"}),Ln=async i=>{const o={};Ar(c=>{Object.entries(c).forEach(([u,h])=>{Object.prototype.hasOwnProperty.call(Pr,u)&&(o[Pr[u]]=h)})}),await Promise.race([tt(6e4),se()]),i(o)};function Cn(...i){return console.warn("@sqs/rum-collector default export is deprecated. Use named export `init` instead."),Nr(...i)}})},function(Pe){var ne=function(Z){return Pe(Pe.s=Z)},$=ne(149876)}]); //# sourceMappingURL=https://sourcemaps.squarespace.net/universal/scripts-compressed/sourcemaps/6e9099910a697a78/performance-0e0c097da8a4dc72-min.en-US.js.map